Skip to content

iview疑难杂症解决 #15

Description

@phoebeCodeSpace

Modal:

slot:

<a slot="close" @click="cancel"><Icon type="ios-close-empty"></Icon></a>
<div slot="footer">
              <Button type="primary" size="large" @click="addcategroy">确定</Button>
              <Button size="large" @click="cancel">取消</Button>
</div>

Attr

footer-hide : hide footer

Modal 中select下拉框位置问题:

.ivu-select-dropdown {
    position: absolute !important;
}

Table

render this指向问题:

new Vue({
	el: '#app',
	data () {
	        const self = this;
		return {
			...写在这里
		}
	}
})

Upload:

清除已上传文件:

设置:default-file-list="defaultList"
清除方法: this.defaultList = []

Form

阻止form表单默认submit事件

 <Form @submit.native.prevent>

按需引用

// 按钮
import Button from 'iviewui/button';
Vue.component('Button', Button);

// 选择列表
import { Select, Option } from 'iviewui/select';
Vue.component('Select', Select);
Vue.component('Option', Option);

// 菜单栏
import Menu from 'iviewui/menu';
Vue.component('Menu', Menu);
Vue.component('Submenu', Menu.Sub );
Vue.component('MenuItem', Menu.Item  );

// 提示消息
import Message from 'iviewui/message';
Vue.component('Message', Message);
Vue.prototype.$Message = Message;

但是最终还是选择 下载源代码,注释不需要的组件,重新打包。。

npm run build

打包生产使用UglifyJs报错

// webpack.base.config.js
module: {
    rules: [
        { test: /iview.src.*?js$/, loader: 'babel' },
        { test: /\.js$/, loader: 'babel', exclude: /node_modules/ }
    ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions