violetjack / feprojectdemos Goto Github PK
View Code? Open in Web Editor NEWVue学习中使用的demo
Vue学习中使用的demo
watch: {
value: {
immediate: true,
handler(val) {
this.showPopper = val; // 这里emit一次input
this.$emit('input', val); //再次emit?why?
}
},
showPopper(val) {
val ? this.updatePopper() : this.destroyPopper();
this.$emit('input', val);
}
},
大神你好,我参考了你的vue单元测试博客,你的demo没有使用i18n国际化,我的有使用,并且我是这样引入i18n的 import i18n from '@/lang'
Vue.use(Element, {
size: 'medium', // set element-ui default size
i18n: (key, value) => i18n.t(key, value)
})
可是它报错了 信息为 ERROR LOG: TypeError: undefined is not an object (evaluating 'i18n._t')
改成
import i18n from '@/lang'
Vue.use(i18n) 也是报这个错,百忙中求解答
appendArrow(element) {
let hash;
if (this.appended) {
return;
}
this.appended = true;
for (let item in element.attributes) {
if (/^_v-/.test(element.attributes[item].name)) { //为什么这里需要剔除v-开头的属性呢
hash = element.attributes[item].name;
break;
}
}
const arrow = document.createElement('div');
if (hash) {
arrow.setAttribute(hash, '');
}
arrow.setAttribute('x-arrow', '');
arrow.className = 'popper__arrow';
element.appendChild(arrow);
}
},
VueTestDemo中单元测试 mocha Hello.spec.js时 会指出import错误,这个问题怎么处理呢
大神你好请问 vm.$el 输出为 怎么回事?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.