查看“︁JavaScript/vue.js/error”︁的源代码
来自康健生活
←
JavaScript/vue.js/error
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 标题文字 == * Cannot assign to read only property 'exports' of object '#<Object>' *: js 可以混用 require、export。但是不能混用import、module.exports * Unknown custom element: <el-menu> - did you register the component correctly *: 没有引用 element-ui *: <syntaxhighlight lang="javascript"> import ElementUI from 'element-ui'; //element-ui的全部组件 Vue.use(ElementUI); //使用elementUI</syntaxhighlight> * Invalid prop: type check failed for prop "collapseTransition". Expected Boolean, got String with value "false". *: 类型错误,加<code>:</code>即可 *: <syntaxhighlight lang="html"> :collapse-transition="false"</syntaxhighlight> * TypeError: Cannot read property 'openedMenus' of undefined,在使用 elementui 时出现错误,按需子组件 vue 页面加载即可 *: <syntaxhighlight lang="javascript"> import {Menu, Submenu, MenuItem, MenuItemGroup} from 'element-ui'; Vue.use(Menu); Vue.use(Submenu); Vue.use(MenuItem); Vue.use(MenuItemGroup);</syntaxhighlight> * Unknown custom element: <el-menu> - did you register the component correctly? For recursive components, make sure to provide the "name" option *: 耗时 5 个小时,试过多个 webpack 方案,经过仔细爬坑,是因为 vue 与 ejs 不兼容导致的(vue-loader 与 html-webpack-plugin 和 ejs-compiled-loader),将 ejs 解析器 替换回 ejs-loader(vue-loader 与 html-webpack-plugin 和 ejs-loader)即可,但是这样就不能使用 ejs 嵌套标签 *: 更正,并不是 (vue-loader 与 html-webpack-plugin 和 ejs-compiled-loader)不兼容,而是重复引入多个 elementui 导致错误 * Do not use built-in or reserved HTML elements as component id: Header *: 模板插入到 DOM 中的标签名须能够被 DOM 正确地解析需要避免完全不合法的标签名 * vue.esm.js:628 [Vue warn]: Failed to mount component: template or render function not defined.found in---> <Anonymous> <App> at view/index/app.vue <Root> *: 路由文件里面改 import Vue from 'vue'; 为 <code>import Vue from 'vue/dist/vue.common.js';</code> * <router-view> 内容不渲染问题 *: <code><router-view class="index" name="NavMenu"></router-view></code> 改为 <code><router-view></router-view></code>,如果一定使用 name(路由命名),name 要与 router.js 内的组件名称一致,是<code>components</code> 而不是 <code>component</code>。 *: <syntaxhighlight lang="javascript"> export default new Router({ routes: [ { path: '/', components: {NavMenu: NavMenu}, children:[] } ] })</syntaxhighlight> * [Vue warn]: Invalid prop: type check failed for prop "index". Expected String, got Number. *: 使用强制类型转换技巧 <code><el-submenu :index="item.id+''"></code> 转换数据类型 * css 样式抽取极其不稳定,只显示 <code>/*# sourceMappingURL=index_page_script.css.map*/</code>。现在遇到的问题是 MiniCssExtractPlugin.loader 可以提取 css 文件打包使用 link 标签插入,或者 vue-style-loader 抽离 vue 文件中的 css 用 style 标签插入<br> 其中 FixStyleOnlyEntriesPlugin 组件一定要与 MiniCssExtractPlugin 同步使用,不然会把 css 的 js 文件删除,导致 css 文件无法插入文本。 * elementui 更改样式无效,修改 css 标签,去掉 scoped *: <syntaxhighlight lang="html"> <style lang="scss" rel="stylesheet/scss" scoped></syntaxhighlight> * Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead *: <syntaxhighlight lang="html5"> <template> <div> <router-view name="default"></router-view> <router-view name="index_main"></router-view> <router-view name="info_main"></router-view> <router-view name="list_main"></router-view> </div> </template></syntaxhighlight> * Vue warn]: Error in render: "TypeError: Cannot read property 'key' of undefi *: 元素加上v-if 指令,判断这个数组中是否有内容,警告即可解除 *: <syntaxhighlight lang="html5"> <div v-if="BospitalSearchFilters[0]"> <span class="sub-nav-title" :value="BospitalSearchFilters[0].key">{{BospitalSearchFilters[0].title}}:</span></syntaxhighlight> * 页面在手机浏览器报错 apiv2.chujingyi.cn/v2/body_parts/all:1 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
此页面嵌入的页面:
模板:Hc
(
查看源代码
)
模板:Hc/style.css
(
查看源代码
)
返回
JavaScript/vue.js/error
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。