Code Monkey home page Code Monkey logo

feprojectdemos's Issues

为什么需要剔除 v-开头的属性呢?

https://github.com/violetjack/VueStudyDemos/blob/75d9f735c8032ff3051b797c3f30016a0b2dc30f/ElementCode/src/utils/vue-popper.js#L69

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);
}

},

单元测试里面有国际化i18n 报错

大神你好,我参考了你的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) 也是报这个错,百忙中求解答

mocha测试问题

VueTestDemo中单元测试 mocha Hello.spec.js时 会指出import错误,这个问题怎么处理呢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.