javascript - How to use weui's picker in vue?
仅有的幸福
仅有的幸福 2017-05-19 10:33:28
0
3
943

I want to use weui's picker in vue.js, and also introduce weui.js. Why is the error weui is not defined reported?

<template>
    <p class="wrap">
       <a href="javascript:;" class="weui-btn weui-btn_default" id="showPicker"》单列选择器</a>
    </p>
</template>
<script>
import weuiJs from '../weui-js/weui.js'
export default {
  methods: {
      checkPicker: function () {
          weui.picker([{
            label: '飞机票',
            value: 0
        }, {
            label: '火车票',
            value: 1
        }, {
            label: '的士票',
            value: 2
        },{
            label: '公交票 (disabled)',
            disabled: true,
            value: 3
        }, {
            label: '其他',
            value: 4
        }], {
            onChange: function (result) {
                console.log(result);
            },
            onConfirm: function (result) {
                console.log(result);
            }
        });
      }
  }
}
</script>
仅有的幸福
仅有的幸福

reply all(3)
阿神
 import weui from 'weui.js' 使用node包引入方式
刘奇

Tryimport weuiJs改成import weui

仅有的幸福

You imported weuijs, and you are using weui.

Solution

  1. Change weuijs to weui

  2. Change weui to weuijs

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!