zhoushengmufc / iosselect

webapp通用选择器
MIT License
1.18k stars 345 forks source link

有vue项目引入示例吗,我老是报错 ”IosSelect is not defined“ #12

Closed TomeZJ closed 7 years ago

TomeZJ commented 7 years ago

import "../assets/libs/iosSelect/iosSelect.css" import "../assets/libs/iosSelect/iosSelect" import "../assets/libs/iosSelect/iscroll"

export default {
    data () {
        return {
          isShow1:true,
          houseProperty: [
            {id: 0, name: "住宅小区"},
            {id: 1, name: "别墅"}
          ]
        }
    },
    created(){
         this.init();
    },
    mounted(){

    },

    components: {},

    computed: {},
    methods: {
        init (){
          new IosSelect(1, this.houseProperty, {
            container: '.selectedModule',
            title: '户型选择',
            itemHeight: 50,
            itemShowCount: 3
          });
        }
    }
}

=========================================== 报错:

[Vue warn]: Error in created hook: (found in at E:\2bossM\m_estimate\estimate\src\components\selectModule.vue)

ReferenceError: IosSelect is not defined at VueComponent.init (eval at 224 (1.js:42), :35:11) at VueComponent.boundFn [as init] (eval at (app.js:877), :126:12) at VueComponent.created (eval at 224 (1.js:42), :25:10) at callHook (eval at (app.js:877), :2274:21) at VueComponent.Vue._init (eval at (app.js:877), :3757:5) at new VueComponent (eval at (app.js:877), :3921:12) at createComponentInstanceForVnode (eval at (app.js:877), :3116:10) at init (eval at (app.js:877), :2924:45) at createComponent (eval at (app.js:877), :4655:9) at createElm (eval at (app.js:877), :4598:9)

TomeZJ commented 7 years ago

新手求解,拜托了

zhoushengmufc commented 7 years ago

需要在iosselect中import iscroll

TomeZJ commented 7 years ago

@zhoushengmufc 那我直接稳定版的,还是报错: app.js:778 ReferenceError: iosSelectUtil is not defined at eval (eval at (1.js:861), :2043:16) at Object.eval (eval at (1.js:861), :3053:3) at eval (eval at (1.js:861), :3054:30) at Object. (1.js:861) at webpack_require (app.js:687) at fn (app.js:106) at eval (eval at (1.js:504), :4:81) at Object. (1.js:504) at webpack_require (app.js:687) at fn (app.js:106)

zhoushengmufc commented 7 years ago

可以直接import merge文件夹下的iosselect 这个和vue没关系 模块依赖不对

TomeZJ commented 7 years ago

模块依赖不对是指哪个模块

TomeZJ commented 7 years ago

[ {id: "0", value: "住宅小区"}, {id: "1", value: "别墅"} ] 这样的数据格式有问题吗?

Error: data format error at IosSelect.setOneLevel (eval at (1.js:861), :2721:11) at IosSelect.init (eval at (1.js:861), :2167:9) at IosSelect (eval at (1.js:861), :2155:8) at VueComponent.init (eval at (1.js:504), :33:7) at VueComponent.boundFn [as init] (eval at (app.js:817), :126:12) at VueComponent.created (eval at (1.js:504), :23:10) at callHook (eval at (app.js:817), :2274:21) at VueComponent.Vue._init (eval at (app.js:817), :3757:5) at new VueComponent (eval at (app.js:817), :3921:12) at createComponentInstanceForVnode (eval at (app.js:817), :3116:10)

TomeZJ commented 7 years ago

在我滑动的时候,会出现bug,O.o

zhoushengmufc commented 7 years ago

readme里有qq群,你加下

wwb568109135 commented 7 years ago

new IosSelect(1, this.houseProperty, { container: '.selectedModule', title: '户型选择', itemHeight: 50, itemShowCount: 3 });

this.houseProperty 这里有问题,要这样写: [ this.houseProperty ]