[great-generator](https://www.npmjs.com/package/great-generator)、 [great-jsutils](https://www.npmjs.com/package/great-jsutils)、 [great-ngform](https://www.npmjs.com/package/great-ngform)、 [great-zorroutils](https://www.npmjs.com/package/great-zorroutil
vue
import {layout} from 'great-vue';
Vue.use(layout);
`
`html
layout-top
菜单栏
layout-bottom
`
menu
`html
`
`js
data(){
return {
menuList:[]
}
},
mounted() {
this.menuList = [
{
text:'布局示例',
link:'#/',
children:[
{
text:'layout01',
link:'#/',
},
{
text:'layout02',
link:'#/layout02',
children:[
{
text:'layout02-01',
link:'#/',
},
{
text:'layout02-02 ',
link:'#/layout02',
}
],
}
]
},
{
text:'卡片示例',
link:'#/card'
}
];
}
`
modal
| 参数 | 说明 | 默认值 | 类型 |
| -----:| :---- | :---- | :---- |
| content | 显示的内容 | 无 | 文本、html片段、vue组件 |
| Vue | 当前Vue对象 | 无 | Vue |
| title | 标题 | 无 | string |
| cancelText | 取消按钮文本,传空则不显示 | 取消 | string |
| okText | 确定按钮文本,传空则不显示 | 确定 | string |
| autoClose | 点击确定、取消按钮后是否自动关闭模态框 | true | boolean |
* 示例:弹出一个普通文本
`js
import { greatModalUtil } from "great-vue";
import Vue from "vue";
openModalHtml() {
greatModalUtil.openModal({
content:'这是一个普通文本',
Vue,
})
.then((v) => {
console.log(v);
});
}
`
* 示例:弹出一个html片段
`js
import { greatModalUtil } from "great-vue";
import Vue from "vue";
openModalHtml() {
greatModalUtil.openModal({
content:'这是一个html片段XX
',
Vue,
})
.then((v) => {
console.log(v);
});
}
`
* 示例:弹出一个自定义组件
`js
import { greatModalUtil } from "great-vue";
import Vue from "vue";
import CardDemo01 from "../card/card-demo01";
openModalHtml() {
greatModalUtil.openModal({
content:CardDemo01,
Vue,
})
.then((v) => {
console.log(v);
});
}
`
card
utils
$3
`js
import {base64Utils} from 'great-vue';
// 判断是否为base64的数据
const isBase64 = base64Utils.isBase64(this.value1);
if(isBase64){
// 将base64解码
this.value2 = base64Utils.decode(this.value1);
}else{
// 用户base64编码
this.value2 = base64Utils.encode(this.value1);
}
`
$3
`js
import {httpUtils} from 'great-vue';
httpUtils.get(url);
httpUtils.post(url, data);
httpUtils.put(url, data);
httpUtils.ajax({url});
`
$3
`vue
number:
``