-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify dataLoad function in a component file and not at the global level #5
Comments
If the data source of <v-selectpage :data="list" v-model="value" @values="values">
</v-selectpage>
//script
data(){
return {
value: '',
list: [
{id:1,name:'aaa'},
{id:2,name:'bbb'},
{id:3,name:'ccc'},
{id:4,name:'ddd'}
]
};
},
methods: {
values(picked){
console.log(picked);
}
} |
But, what if I want to use it server side. Having the axios function located in the main.js file is really out of the way if I need to customize/change anything per request. Debouncing comes up as an issue too, since it calls back on every keystroke. I'm gonna make a pull request with some enhancements :) Thanks for the hard work on the control! |
Config The [
{id:1,name:'aaa'},
{id:2,name:'bbb'},
{id:3,name:'ccc'},
{id:4,name:'ddd'},
]
So the conclusion is set When useing |
这样全局配置确实有不方便的地方,例如后台使用graphql的时候,需要把搜索的内容作为参数拼接到查询字符串里面传给后台,因为字符串的内容比较长,使用了ES6的字符串模板,不同地方使用的字符串不一样,全局配置不够灵活,例如下面的字符串模板: |
首先每个插件都是可以单独设置 <v-selectpage :data-load="dataLoad">
</v-selectpage>
//script
methods: {
dataLoad () {
do something...
}
} |
//script |
I want to use this in different vue components. How can I use this without specifying the
dataLoad
function inmain.js
?The text was updated successfully, but these errors were encountered: