为什么不呈现组件数据对象属性

时间:2018-10-07 17:24:09

标签: javascript vue.js

组件数据对象中的

属性未在前端使用。我是Vue的新手,所以我希望学习新的东西。

在此快速布局实施之后,我安装了该组件,一切都很好:https://vuejsexamples.com/a-vue-plugin-to-quickly-generate-a-webapplication-layout/

我确实将变量function consumeCharacters(amount) { return (characterArray) => { return characterArray.splice(0, amount).join(''); }; } function parseSimpleRegex(regexString) { // filter out backslash escapes let parsed = regexString.replace(/\\./g, (...args) => { return args[0][args[0].length-1]; }); // get literal characters let literals = parsed.split(/d\{\d\}/); // get variable symbols let variables = parsed.match(/d\{\d\}/g); let varFunctions = variables.map(variable => consumeCharacters(variable[2])); let result = []; while (literals.length > 0) { result.push(literals.shift()); result.push(varFunctions.shift()); } while (varFunctions.length > 0) { result.push(varFunctions.shift()); } // filter out undefineds & empty strings result = result.filter(resultPart => !!resultPart); return result; } function format(regexString, rawString) { let rawCharacters = rawString.split(''); let formatter = null; try { formatter = parseSimpleRegex(regexString); } catch (e) { return 'failed parsing regex'; } let formattedString = formatter.map((format) => { if (typeof format === 'string') { return format; } if (typeof format === 'function') { return format(rawCharacters); } }).join(''); return formattedString; } const testCases = [ { args: ["\\(\\d{3}\\) \\d{3}-\\d{4}", "1234567890"], expected: "(123) 456-7890" }, { args: ["\\d{4}-\\d{2}-\\d{2}", "20180712"], expected: "2018-07-12" }, { args: ["([A-Z]+-\\d+ )+", "ABC123DEFGH45IJ6789"], expected: "ABC-123 DEFGH-45 IJ-6789 " }, ]; testCases.forEach((testCase, index) => { const result = format(...testCase.args); const expected = testCase.expected; if (result === expected) { console.log(`Test Case #${index+1} passed`); } else { console.log(`Test Case #${index+1} failed, expected: "${expected}", result: "${result}"`); } });设置为true,但是在前端,它不起作用:

hiddenRight

在我的Vue检查器中,data () { return { minifiedLeft: false, minifiedRight: false, hiddenLeft: false, hiddenRight: true, }; }, 对象中的所有属性都设置为false。看来他们没有更新。

all variables are set to false

浏览器缓存失效:

enter image description here

每次保存项目时都会重新加载站点。 能给我个小提示吗?

谢谢!

完整代码:main.js

data

App.vue

import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false

new Vue({
   render: h => h(App)
}).$mount('#app')

这是安装在节点模块中的模块:

enter image description here

0 个答案:

没有答案