我正在vuejs中构建一个自动完成组件。
此刻,我陷入了滚动动画中。
目的是单击箭头键作为键的方向滚动,但是仅当该选项不可见时才执行滚动。
我想要这种东西,但是在vue / javascript中。- http://jsfiddle.net/kMzR9/3/
如果您由于屏幕很小而在我离开的示例中看不到问题,那么这里是jsfiddle- https: //jsfiddle.net/v7yd94r5/
这是我所拥有的一个例子。
const Autocomplete = {
name: "autocomplete",
template: "#autocomplete",
props: {
items: {
type: Array,
required: false,
default: () => []
},
isAsync: {
type: Boolean,
required: false,
default: false
}
},
data() {
return {
isOpen: false,
results: [],
search: "",
isLoading: false,
arrowCounter: 0
};
},
methods: {
onChange() {
// Let's warn the parent that a change was made
this.$emit("input", this.search);
// Is the data given by …Run Code Online (Sandbox Code Playgroud)我有一个相当大的 VueJS SPA,我只想使用延迟加载在某些路由上加载 vuex 模块。
我正在关注这篇文章来重现此内容 - https://alexjoverm.github.io/2017/07/16/Lazy-load-in-Vue-using-Webpack-s-code-splitting/
然而,这给了我一个 vuex 错误。
文件夹结构
root
|- store
| |- modules
| | |- auth.js
| | |- module2.js
| |- store.js
|- app.js
Run Code Online (Sandbox Code Playgroud)
auth.js
const state = {
var1: {},
var2: false
}
const mutations = {
'MUTATION_1'(state, obj) {
// logic
}
}
const actions = {
action1({commit}) {
// logic
}
}
const getters = {
var1: state => state.var1,
var2: state => state.var2
}
export default {
state,
mutations, …Run Code Online (Sandbox Code Playgroud)