Unlinked Gradle project

导入新项目到AS时报错:

Unlinked Gradle project...

导致项目不能编译。重复导了几次也一样。

解决方法:
点击Import Project,定位到项目所在的目录,找到其中的build.gradle文件,然后点击OK按钮。
这里写图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
const relationFunctions = { ancestor: { linked(parent) { this.parent = parent; }, unlinked() { this.parent = null; }, }, descendant: { linked(child) { this.children = this.children || []; this.children.push(child); }, unlinked(child) { this.children = (this.children || []).filter((it) => it !== child); }, }, }; function mapKeys(source, target, map) { Object.keys(map).forEach((key) => { if (source[key]) { target[map[key]] = source[key]; } }); } function makeRelation(options, vantOptions, relation) { const { type, name, linked, unlinked, linkChanged } = relation; const { beforeCreate, destroyed } = vantOptions; if (type === 'descendant') { options.created = function () { beforeCreate && beforeCreate.bind(this)(); this.children = this.children || []; }; options.detached = function () { this.children = []; destroyed && destroyed.bind(this)(); }; } options.relations = Object.assign(options.relations || {}, { [`../${name}/index`]: { type, linked(node) { relationFunctions[type].linked.bind(this)(node); linked && linked.bind(this)(node); }, linkChanged(node) { linkChanged && linkChanged.bind(this)(node); }, unlinked(node) { relationFunctions[type].unlinked.bind(this)(node); unlinked && unlinked.bind(this)(node); }, }, }); } function VantComponent(vantOptions = {}) { const options = {}; mapKeys(vantOptions, options, { data: 'data', props: 'properties', mixins: 'behaviors', methods: 'methods', beforeCreate: 'created', created: 'attached', mounted: 'ready', relations: 'relations', destroyed: 'detached', classes: 'externalClasses', }); const { relation } = vantOptions; if (relation) { makeRelation(options, vantOptions, relation); } // add default externalClasses options.externalClasses = options.externalClasses || []; options.externalClasses.push('custom-class'); // add default behaviors options.behaviors = options.behaviors || []; options.behaviors.push(basic); // map field to form-field behavior if (vantOptions.field) { options.behaviors.push('wx://form-field'); } if (options.properties) { Object.keys(options.properties).forEach((name) => { if (Array.isArray(options.properties[name])) { // miniprogram do not allow multi type options.properties[name] = null; } }); } // add default options options.options = { multipleSlots: true, addGlobalClass: true, }; Component(options); } export { VantComponent };
06-01

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值