Giter Site home page Giter Site logo

weui-miniprogram's Introduction

WeUI组件库简介

这是一套基于样式库weui-wxss开发的小程序扩展组件库,同微信原生视觉体验一致的扩展组件库,由微信官方设计团队和小程序团队为微信小程序量身设计,令用户的使用感知更加统一。

如何使用

详细使用参考文档

开发

  1. 初始化
npm run init
  1. 执行命令:
npm run dev
  1. 构建组件库:
npm run build

适配 DarkMode

在根结点(或组件的外层结点)增加属性 data-weui-theme="dark",即把 WeUI 组件切换到 DarkMode 的表现,如:

<view data-weui-theme="dark">
    ...
</view>

weui-miniprogram's People

Contributors

center1024 avatar cunjinli6 avatar damonamber avatar fatpandac avatar juneandgreen avatar lsnsh avatar michaelxuzhi avatar perryhou avatar seasonhuang avatar synclife avatar tidyzq avatar ttzztztz avatar wechat-miniprogram-admin avatar xxxbw avatar xysdavid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

weui-miniprogram's Issues

表单自定义 validator 疑似 bug

我不确定是 bug 还是我的使用方法有问题,如果是用错了,希望能够补充一下正确的使用范例,目前文档中没有 validator 相关的 demo 。

form rules 配置如下:

[
      {
        name: "cardNo",
        rules: { validator: bankNoValidator }
      }
]

但 bankNoValidator 没有被调用,追溯到这里发现问题:

if (ruleKey === 'validator' || ruleKey === 'name' || ruleKey === 'message') continue

ruleKey 为 validator 会被跳过,也就是说我必须再设置一个 message name 以外的字段才能让 validator 生效。按照文档,别的字段要么是内置校验规则,要么没有意义。如果是内置规则,下一条语句又会让内置规则失效,只执行 validator ,想不通这段逻辑的目的。

npm install 失败

Error: File not found with singular glob: /Users/XX/WeChatProjects/weui-miniprogram/src/weui-wxss/dist/style/weui.wxss (if this was purposeful, use allowEmpty option)

slideview

./miniprogram_npm/weui-miniprogram/slideview/slideview.wxml
Now you can provide attr wx:key for a wx:for to improve performance.

gallery中使用了 delete 属性,会导致编译webpack编译失败

<view class="weui-gallery__opr" wx:if="{{delete}}"> <navigator href="javascript:" bindtap="deleteImg" class="weui-gallery__del">删除</navigator> </view>
`
ERROR in ./node_modules/weui-miniprogram/miniprogram_dist/gallery/gallery.wxml?__resource=D:/personal/mpx/node_modules/weui-miniprogram/miniprogram_dist/gallery/gallery (./node_modules/@mpxjs/webpack-plugin/lib/extractor.js?type=templa
te&index=0!./node_modules/@mpxjs/webpack-plugin/lib/wxml/wxml-loader.js?root=!./node_modules/@mpxjs/webpack-plugin/lib/template-compiler?{"usingComponents":["van-tabbar","van-tabbar-item"],"hasScoped":false,"hasComment":false,"isNative
":true,"moduleId":"5f0bf755"}!./node_modules/weui-miniprogram/miniprogram_dist/gallery/gallery.wxml?__resource=D:/personal/mpx/node_modules/weui-miniprogram/miniprogram_dist/gallery/gallery)
Module build failed (from ./node_modules/@mpxjs/webpack-plugin/lib/template-compiler/index.js):
SyntaxError: Unexpected token )
at new Function ()
at evalExp (D:\personal\mpx\node_modules@mpxjs\webpack-plugin\lib\template-compiler\compiler.js:1264:14)
at postProcessIf (D:\personal\mpx\node_modules@mpxjs\webpack-plugin\lib\template-compiler\compiler.js:1279:14)
at closeElement (D:\personal\mpx\node_modules@mpxjs\webpack-plugin\lib\template-compiler\compiler.js:1570:3)
at Object.end (D:\personal\mpx\node_modules@mpxjs\webpack-plugin\lib\template-compiler\compiler.js:740:9)
at parseEndTag (D:\personal\mpx\node_modules@mpxjs\webpack-plugin\lib\template-compiler\compiler.js:463:19)
at parseHTML (D:\personal\mpx\node_modules@mpxjs\webpack-plugin\lib\template-compiler\compiler.js:273:11)
at Object.parse (D:\personal\mpx\node_modules@mpxjs\webpack-plugin\lib\template-compiler\compiler.js:665:3)
at Object.module.exports (D:\personal\mpx\node_modules@mpxjs\webpack-plugin\lib\template-compiler\index.js:23:25)
@ ./node_modules/weui-miniprogram/miniprogram_dist/gallery/gallery.js (./node_modules/@mpxjs/webpack-plugin/lib/native-loader.js?{"transRpx":{"mode":"only","comment":"use rpx","include":"D://personal//mpx//src"}}!./node_modules/weui-m
iniprogram/miniprogram_dist/gallery/gallery.js) 9:0-451

`

uploader上传的图片预览的时候无法遮挡住下面cell里面的textarea

表单中先用的uploader 下面是cell里面的textarea
真机调试(iphone11)预览图片无法挡住textarea
在电脑上预览没有这个问题
`



      <mp-cells title="产品简介">
          <mp-cell show-error prop="idcard" title="" ext-class="">
              <textarea bindinput="formInputChange" data-field="idcard" class="weui-textarea" placeholder="请输入产品介绍"/>
          </mp-cell>
      </mp-cells>`

npm run dev 出错

PS D:\WechatApps\weui-miniprogram-master> npm run dev

[email protected] dev D:\WechatApps\weui-miniprogram-master
gulp dev --develop

[19:12:29] Using gulpfile D:\WechatApps\weui-miniprogram-master\gulpfile.js
[19:12:29] Starting 'dev'...
[19:12:29] Starting 'weui-miniprogram-dev'...
[19:12:29] Starting 'weui-miniprogram-build'...
[19:12:29] Starting 'weui-miniprogram-clean-dist'...
[19:12:29] Finished 'weui-miniprogram-clean-dist' after 31 ms
[19:12:29] Starting 'weui-miniprogram-component-check'...
[19:12:29] Finished 'weui-miniprogram-component-check' after 102 ms
[19:12:29] Starting 'weui-miniprogram-component-wxml'...
[19:12:29] Starting 'weui-miniprogram-component-js'...
[19:12:29] Starting 'weui-miniprogram-component-less'...
[19:12:29] Starting 'weui-miniprogram-component-wxss'...
[19:12:29] Starting 'weui-miniprogram-component-json'...
[19:12:29] Starting 'weui-miniprogram-copy'...
[19:12:29] Starting 'weui-miniprogram-package-json'...
[19:12:29] Finished 'weui-miniprogram-component-js' after 433 ms
[19:12:29] Finished 'weui-miniprogram-component-wxss' after 451 ms
[19:12:29] Starting ''...
[19:12:29] Starting ''...
[19:12:29] Finished 'weui-miniprogram-package-json' after 489 ms
[19:12:29] Finished '' after 11 ms
[19:12:29] Finished '' after 11 ms
[19:12:29] Finished 'weui-miniprogram-copy' after 502 ms
[19:12:29] 'weui-miniprogram-component-wxml' errored after 552 ms
[19:12:29] Error: File not found with singular glob: D:/WechatApps/weui-miniprogram-master/src/weui-wxss/dist/style/weui.wxss (if this was purposeful, use allowEmpty option)
at Glob. (D:\WechatApps\weui-miniprogram-master\node_modules\glob-stream\readable.js:84:17)
at Object.onceWrapper (events.js:297:20)
at Glob.emit (events.js:209:13)
at Glob.EventEmitter.emit (domain.js:476:20)
at Glob._finish (D:\WechatApps\weui-miniprogram-master\node_modules\glob\glob.js:197:8)
at done (D:\WechatApps\weui-miniprogram-master\node_modules\glob\glob.js:182:14)
at Glob._processSimple2 (D:\WechatApps\weui-miniprogram-master\node_modules\glob\glob.js:688:12)
at D:\WechatApps\weui-miniprogram-master\node_modules\glob\glob.js:676:10
at Glob.stat2 (D:\WechatApps\weui-miniprogram-master\node_modules\glob\glob.js:772:12)
at lstatcb
(D:\WechatApps\weui-miniprogram-master\node_modules\glob\glob.js:764:12)
[19:12:29] 'weui-miniprogram-build' errored after 693 ms
[19:12:29] 'weui-miniprogram-dev' errored after 696 ms
[19:12:29] 'dev' errored after 701 ms
[19:12:29] The following tasks did not complete: weui-miniprogram-component-less, weui-miniprogram-component-json
[19:12:29] Did you forget to signal async completion?
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: gulp dev --develop
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\scott.wan\AppData\Roaming\npm-cache_logs\2019-08-31T11_12_29_852Z-debug.log

添加组件需求

期望组件。
1、拖动排序组件
2、类似微信右上角 + 号点击弹出的冒泡菜单(发起群聊,添加朋友,扫一扫。。。)
3、局部上下刷新组件

slideview

slideview展开状态怎么清除?想用他做购物车,感觉很难

在列表中使用slideview,删除一个slideview,会导致button颜色异常,由红色变为白色

<view class="page">
  <mp-slideview wx:for="{{list}}" wx:key="index" buttons="{{list[index].slide}}" bindbuttontap="slideButtonTap">
    <mp-cell>{{item.index}}</mp-cell>
  </mp-slideview>
</view>

list: [{
          index: 0,
          slide: [{
            type: 'warn',
            text: '删除',
            data: 0
          }]
        },
        {
          index: 1,
          slide: [{
            type: 'warn',
            text: '删除',
            data: 1
          }]
        },
        {
          index: 2,
          slide: [{
            type: 'warn',
            text: '删除',
            data: 2
          }]
        }, {
          index: 3,
          slide: [{
            type: 'warn',
            text: '删除',
            data: 3
          }]
        }
      ]

slideButtonTap(e) {
    let index = e.detail.data
    let list = this.data.list
    list.splice(index, 1)
    this.setData({
      list: list
    })
    console.log('slide button tap', e.detail)
  }

给uploader传入files数据后,再次上传报错

场景:用户修改资料页面,之前上传的图片数据传给uploader渲染后,再次上传的时候报错
(err TypeError: Cannot set property 'url' of undefined)

发现问题:在uploader源码里有段这样的代码:

if (json.urls) {
  var oldFiles = _this.data.files;
  json.urls.forEach(function (url, index) {
    oldFiles[len + index].url = url;
    oldFiles[len + index].loading = false;
  });
  _this.setData({
    files: oldFiles,
    currentFiles: newFiles
  });
  _this.triggerEvent('success', json, {});
}

json.urls应该就选择上传的图片路径数组,json.urls写了遍历,url应该是一个对象,而oldFiles[len + index].url的赋值应该是个图片路径字符串,这里赋值了url会发生报错

解决:
oldFiles[len + index].url = url; 改成:oldFiles[len + index]= url;

录音接口更新

哥哥!案例中使用的录音API使用的是停止维护的API。能来个新API的案例吗。。。不同环境下不同回调事件会不执行。。。心好累。

slideview 异常

点击按钮slideview 组件时出现以下异常信息

Component "components/slideview/slideview" does not have a method "function (nv_event,nv_ownerInstance){var nv_ins = nv_event.nv_instance;var nv_st = nv_ins.nv_getState();if (!nv_st.nv_size || !nv_st.nv_isMoving)return;;nv_st.nv_isMoving = false;var nv_btns = nv_ownerInstance.nv_selectAllComponents('.btn');var nv_len = nv_btns.nv_length;var nv_i = nv_len - 1;if (Math.nv_abs(nv_event.nv_changedTouches[(0)].nv_pageX - nv_st.nv_startX) < nv_st.nv_throttle || nv_event.nv_changedTouches[(0)].nv_pageX - nv_st.nv_startX > 0){nv_st.nv_out = false;nv_ins.nv_setStyle(({'nv_transform':'translate3d(0px, 0, 0)','nv_transition':'transform 0.4s',}));for(;nv_i >= 0;nv_i--){nv_btns[((nt_12=(nv_i),null==nt_12?undefined:'number'=== typeof nt_12?nt_12:"nv_"+nt_12))].nv_setStyle(({'nv_transform':'translate3d(0px, 0, 0)','nv_transition':'transform 0.4s',}))};nv_ownerInstance.nv_callMethod('hide');return};var nv_movex = nv_st.nv_max;nv_st.nv_out = true;nv_ins.nv_setStyle(({'nv_transform':'translate3d(' + (-nv_movex) + 'px, 0, 0)','nv_transition':'transform 0.4s',}));nv_st.nv_transformx = -nv_movex;var nv_transformTotal = 0;for(;nv_i >= 0;nv_i--){var nv_transform = nv_st.nv_size.nv_buttons[((nt_13=(nv_i),null==nt_13?undefined:'number'=== typeof nt_13?nt_13:"nv_"+nt_13))].nv_width / nv_st.nv_max * nv_movex;var nv_transformx = (-(nv_transform + nv_transformTotal));nv_btns[((nt_14=(nv_i),null==nt_14?undefined:'number'=== typeof nt_14?nt_14:"nv_"+nt_14))].nv_setStyle(({'nv_transform':'translate3d(' + nv_transformx + 'px, 0, 0)','nv_transition':'transform 0.4s',}));nv_st.nv_size.nv_buttons[((nt_15=(nv_i),null==nt_15?undefined:'number'=== typeof nt_15?nt_15:"nv_"+nt_15))].nv_transformx = nv_transformx;nv_transformTotal += nv_transform};nv_ownerInstance.nv_callMethod('show')}" to handle event "touchend".

form 表单中,prop 无明显作用

无论 prop 是否设置,都能正常校验。

 <mp-form id="form" rules="{{rules}}" models="{{formData}}">
      <mp-cells>

    <!-- 这里的 prop ,即使不设置,也依然能正常校验 -->
        <mp-cell prop="title"> 
          <input value="{{formData.title}}" bindinput="formInputChange" data-field="title" class="weui-input" placeholder="请填写标题" />
        </mp-cell>
        <mp-cell>
</mp-form> 
rules: [{
        required: true,
        message: '请填写标题'
      },]
 this.selectComponent('#form').validateField('title', (valid, errors) => {
      console.log(valid, errors)
    })

这里的回调会被执行 两次

// 第一次结果
false  {message: "请填写标题"......}

// 第二次结果
false  undefined

当 form 表单的 rule name 为 “name” 时,校验回调值出错

当 form 表单的 rule name 为 “name” 时,如下:

rules: [{
    name: 'name',
    rules: { required: true, message: '名称不能为空' },
}]

在不填写“名称 name”,也即 formData.name = null 时, valid 为 false

this.selectComponent('#form').validate((valid, errors) => {
    console.log(valid, errors); //  false  ["name"]
})

显然的到的 errors 是不正确的。

正常的 errors 应该为

[{
    message: "名称不能为空",
    rule: { required: true, message: '名称不能为空' }
}]

应当在文档中注明mp-tabbar图片路径以何为标准

应当在文档中标注,mp-tabbar的list中iconPath与selectedIconPath两项,不是以当前page的相对路径为准,而是以miniprogram_npm中的组件文件来计算相对路径。
当前文档中未明确注明,容易让新手以为是以当前page的js为相对路径的,导致mp-tabbar中图片一直无法正常显示

npm run dev 报错

按照 README.md 执行完 npm install 之后,运行 npm run dev 报错。

[09:05:49] 'weui-miniprogram-component-wxml' errored after 248 ms
[09:05:49] Error: File not found with singular glob: /Users/dkvirus/Documents/github/weui-miniprogram/src/weui-wxss/dist/style/weui.wxss (if this was purposeful, use `allowEmpty` option)
    at Glob.<anonymous> (/Users/dkvirus/Documents/github/weui-miniprogram/node_modules/glob-stream/readable.js:84:17)
    at Object.onceWrapper (events.js:273:13)
    at Glob.emit (events.js:182:13)
    at Glob.EventEmitter.emit (domain.js:441:20)
    at Glob._finish (/Users/dkvirus/Documents/github/weui-miniprogram/node_modules/glob/glob.js:197:8)
    at done (/Users/dkvirus/Documents/github/weui-miniprogram/node_modules/glob/glob.js:182:14)
    at Glob._processSimple2 (/Users/dkvirus/Documents/github/weui-miniprogram/node_modules/glob/glob.js:688:12)
    at /Users/dkvirus/Documents/github/weui-miniprogram/node_modules/glob/glob.js:676:10
    at Glob._stat2 (/Users/dkvirus/Documents/github/weui-miniprogram/node_modules/glob/glob.js:772:12)
    at lstatcb_ (/Users/dkvirus/Documents/github/weui-miniprogram/node_modules/glob/glob.js:764:12)
[09:05:49] 'weui-miniprogram-build' errored after 343 ms
[09:05:49] 'weui-miniprogram-dev' errored after 343 ms
[09:05:49] 'dev' errored after 346 ms
[09:05:49] The following tasks did not complete: weui-miniprogram-component-less, weui-miniprogram-component-json
[09:05:49] Did you forget to signal async completion?

看问题找到了 src/weui-wxss 目录,貌似该目录下没有 dist 目录导致的。

期望:官方生成 dist 目录,使得 npm run dev 能正常启动项目,用户体验友好。

npm run init 报错 primordials is not defined

const { Math, Object } = primordials;
^
ReferenceError: primordials is not defined
at fs.js:27:26
at req_ (/Volumes/apple/source/github/weui-miniprogram/src/weui-wxss/node_modules/natives/index.js:143:24)
at Object.req [as require] (/Volumes/apple/source/github/weui-miniprogram/src/weui-wxss/node_modules/natives/index.js:55:10)
at Object. (/Volumes/apple/source/github/weui-miniprogram/src/weui-wxss/node_modules/graceful-fs/fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:681:19)
at require (internal/modules/cjs/helpers.js:16:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm run init出错

npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code E404

npm ERR! 404 Not found : @tencent/tslint-config-wxapp
npm ERR! 404
npm ERR! 404 '@tencent/tslint-config-wxapp' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)

npm ERR! 404 It was specified as a dependency of 'weui-miniprogram'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

真机调试 searchbar 出错

  1. 按照readme执行npm run init、npm run dev
  2. 用开发者工具打开miniprogram_dev目录
  3. 使用真机调试,点击“searchbar”后
    报JS错误:
    jsEnginScriptError
    Component is not found in path "components/searchbar/searchbar" (using by "example/searchbar/searchbar");onAppRoute
    Error: Component is not found in path "components/searchbar/searchbar" (using by "example/searchbar/searchbar")
    at H (WAService.js:1:1302208)
    at H (WAService.js:1:1302412)
    at WAService.js:1:1319968
    at Module.Fe (WAService.js:1:1320547)
    at Function.value (WAService.js:1:1350860)
    at Tt (WAService.js:1:1366302)
    at WAService.js:1:1368724
    at xt (WAService.js:1:1368770)
    at Function. (WAService.js:1:1374284)
    at i. (WAService.js:1:1343799)

npm run init 总是提示 weui-miniprogram-master\node_modules\less: Appears to be a git repo or submo

【日志如下】:
npm ERR! path F:\dev\wx-xcx\study\weui-miniprogram-master\node_modules\less
npm ERR! code EISGIT
npm ERR! git F:\dev\wx-xcx\study\weui-miniprogram-master\node_modules\less: Appears to be a git repo or submo
dule.
npm ERR! git F:\dev\wx-xcx\study\weui-miniprogram-master\node_modules\less
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

npm ERR! A complete log of this run can be found in:
npm ERR! E:\dev\NodeJs\node-v8.4.0-win-x86\node-cache_logs\2019-08-17T17_53_25_690Z-debug.log

form 表单自定义校验函数 validator 无效

rules: [{
      name: 'title',
      rules: [{
        validator: function (rule, value, param, models) {
          console.log('custom validator called: ', rule, value)
          return false
        },
        message: '请填写标题'
      }]
}],

自定义校验函数不会被执行

原因应该是 validator 被 continue 了

const validateSingleRule = (rule: any, value:any, param:any = null, models = null) => {
    let message = ''
    for (const ruleKey in rule) {
        if (ruleKey === 'validator' || ruleKey === 'name' || ruleKey === 'message') continue
        const validateMethod = typeof rule.validator !== 'undefined' ? rule.validator : Validator[ruleKey]
        if (typeof validateMethod === 'function') {
            message = validateMethod(rule, value, param, models)
            if (message) {
                return message
            }
        }

    }
    return message
}

项目中的 demo 导入失败

导入 demo 文件夹后,启动项目报错:
Error:
in File: ./app.wxss
File not found ./components/weui-wxss/dist/style/weui.wxss

微信开发者工具上传代码时会做tree shaking吗?

我直接把整个miniprogram_dist文件夹添加到小程序工程里使用,我想请问一下微信开发者工具上传代码时会做tree shaking吗?就是会把未引用的组件代码去除掉吗?
还有我看到miniprogram_dist文件夹里的组件文件夹的js文件都包含有webpack打包的代码,请问这些代码的作用是什么呢?
image

表单验证问题:required: false 失效、无法验证空数组

  • 表单验证会忽略required: false
    例:手机号验证写了 mobile: true, 由于需求手机号不是必填,所以加多了条required: false,
    但验证结果依然会出现手机号必填。

//手机号校验
{
name: 'mobile',
rules: [{
required: false,
message: '选填'
}, {
mobile: true,
message: "请填写正确的手机号"
}],
},

  • 无法判断空数组,会跳过数组的验证
    例:无法验证复选框选择状态

表单equalTo相等校验始终校验不通过

rules: [{ // 多个规则
name: 'password',
rules: [{
required: true,
message: '请输入密码'
}, {
minlength: 6,
message: '请输入最少6位长度的密码'
}],
}, { // 多个规则
name: 'confirm',
rules: [{
required: true,
message: '请再次输入密码'
}, {
equalTo: 'password',
message: '两次输入密码不一致'
}],
}]

希望添加 drawer 组件

drawer 组件:抽屉组件

支持上下左右四个方向划出。

左边划出场景:小说目录

image

下边划出场景:电商网站选择规格

image

npm 依赖安装失败

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@tencent%2ftslint-config-wxapp - Not found
npm ERR! 404
npm ERR! 404 '@tencent/[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'weui-miniprogram'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

项目运行npm run init时报错

C:\Users\Administrator\Desktop\weui-miniprogram-master>npm run init

> [email protected] init C:\Users\Administrator\Desktop\weui-miniprogram-master
> npm i && cd src/weui-wxss && npm i && gulp build:style && cd ../../ && npm run dev

npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
npm WARN deprecated [email protected]: use String.prototype.padStart()
npm ERR! code E404
npm ERR! 404 Not Found: @tencent/[email protected]

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-08-01T10_02_51_675Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] init: `npm i && cd src/weui-wxss && npm i && gulp build:style && cd ../../ && npm run dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] init script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-08-01T10_02_51_743Z-debug.log

C:\Users\Administrator\Desktop\weui-miniprogram-master>

在 cells 组件中使用了 vue 的 v-if 和 template

由于使用了 vue 的 v-if 导致自定义 footer 无法显示

<view class="{{extClass}}">
    <view wx:if="{{title}}" class="weui-cells__title">{{title}}</view>
    <view class="weui-cells weui-cells_after-title {{checkboxCount > 0 && checkboxIsMulti ? 'weui-cells_checkbox' : ''}}">
        <slot></slot>
    </view>
    <view v-if="{{footer}}" class="weui-cells__tips">{{footer}}</view>
    <template v-else><slot name="footer"></slot></template>
</view>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.