更改历史
* 2019-06-28 高天阳 初始化文档
npm install iview-loader --save-dev
module: {
rules: [
{
test: /\.vue$/,
use: [
{
loader: 'vue-loader',
options: {
}
},
{
loader: 'iview-loader',
options: {
prefix: false
}
}
]
}
]
}
{
'i-affix': 'Affix',
'i-alert': 'Alert',
'i-anchor': 'Anchor',
'i-anchor-link': 'AnchorLink',
'i-auto-complete': 'AutoComplete',
'i-avatar': 'Avatar',
'i-back-top': 'BackTop',
'i-badge': 'Badge',
'i-breadcrumb': 'Breadcrumb',
'i-breadcrumb-item': 'BreadcrumbItem',
'i-button': 'Button',
'i-button-group': 'ButtonGroup',
'i-card': 'Card',
'i-carousel': 'Carousel',
'i-carousel-item': 'CarouselItem',
'i-cascader': 'Cascader',
'i-cell': 'Cell',
'i-cell-group': 'CellGroup',
'i-checkbox': 'Checkbox',
'i-checkbox-group': 'CheckboxGroup',
'i-circle': 'i-circle',
'i-col': 'Col',
'i-collapse': 'Collapse',
'i-color-picker': 'ColorPicker',
'i-content': 'Content',
'i-divider': 'Divider',
'i-date-picker': 'DatePicker',
'i-drawer': 'Drawer',
'i-dropdown': 'Dropdown',
'i-dropdown-item': 'DropdownItem',
'i-dropdown-menu': 'DropdownMenu',
'i-footer': 'Footer',
'i-form': 'Form',
'i-form-item': 'FormItem',
'i-header': 'Header',
'i-icon': 'Icon',
'i-input': 'Input',
'i-input-number': 'InputNumber',
'i-layout': 'Layout',
'i-menu': 'Menu',
'i-menu-group': 'MenuGroup',
'i-menu-item': 'MenuItem',
'i-sider': 'Sider',
'i-submenu': 'Submenu',
'i-modal': 'Modal',
'i-option': 'Option',
'i-option-group': 'OptionGroup',
'i-page': 'Page',
'i-panel': 'Panel',
'i-poptip': 'Poptip',
'i-progress': 'Progress',
'i-radio': 'Radio',
'i-radio-group': 'RadioGroup',
'i-rate': 'Rate',
'i-row': 'Row',
'i-select': 'Select',
'i-slider': 'Slider',
'i-spin': 'Spin',
'i-split': 'Split',
'i-step': 'Step',
'i-steps': 'Steps',
'i-switch': 'i-switch',
'i-table': 'Table',
'i-tabs': 'Tabs',
'i-tab-pane': 'TabPane',
'i-tag': 'Tag',
'i-time': 'Time',
'i-timeline': 'Timeline',
'i-timeline-item': 'TimelineItem',
'i-time-picker': 'TimePicker',
'i-tooltip': 'Tooltip',
'i-transfer': 'Transfer',
'i-tree': 'Tree',
'i-upload': 'Upload'
}
<i-timeline class="time-content-box">
<i-timeline-item>
<p class="time-title">时间</p>
<p class="time-content">内容</p>
</i-timeline-item>
</i-timeline>
分析:由于eslint无法识别timeline导致其在编译过程中提示标签未封闭 从而导致编译失败
import Vue from 'vue'
import iView from 'iview'
Vue.component('i-time-line-item', iView.TimelineItem)
<i-timeline class="time-content-box">
<i-time-line-item>
<p class="time-title">时间</p>
<p class="time-content">内容</p>
</i-time-line-item>
</i-timeline>
<i-menu>
<i-submenu name="a">
<template slot="title">
A
</template>
<i-menu-item name="a1" to="/a/a1">B</i-menu-item>
<i-menu-item name="a2" to="/a/a2">C</i-menu-item>
</i-submenu>
<i-menu-item name="b" to="/b">
B
</i-menu-item>
<i-menu-item name="c" to="/c">
C
</i-menu-item>
</i-menu>
分析:暂时未查出问题原因 猜测是iview-loader中重命名的组件与iview原本的组件存在冲突 导致的异常
import Vue from 'vue'
import iView from 'iview'
Vue.component('i-ym-submenu', iView.Submenu)
<i-menu>
<i-ym-submenu name="a">
<template slot="title">
A
</template>
<i-menu-item name="a1" to="/a/a1">B</i-menu-item>
<i-menu-item name="a2" to="/a/a2">C</i-menu-item>
</i-ym-submenu>
<i-menu-item name="b" to="/b">
B
</i-menu-item>
<i-menu-item name="c" to="/c">
C
</i-menu-item>
</i-menu>