全局配置

在引入 Avue 时,可以传入一个全局配置对象

const app =createApp({});
app.use(AVUE,{
  size:'',
  crudOption:{},
  formOption:{},
  appendToBody:true,
  modalAppendToBody:true,
  cos:{},
  qiniu:{},
  ali:{},
  canvas:{}
});
  • size:用于改变组件的默认尺寸,属性的组件的默认尺寸均为 small。可选值small/mini/medium;
  • crudOption:全局Crud组件的默认配置
  {
    index:true,
    indexLabel:'序号',
    ....
  }
  • formOption:全局Form组件的默认配置
  {
    labelWidth:110,
    ....
  }
  • qiniu 七牛云配置
  {
    AK: '',
    SK: '',
    scope: '',
    url: '',
    deadline: 1
  }
  • ali 阿里云配置
  {
    region: '',
    endpoint: '',
    accessKeyId: '',
    accessKeySecret: '',
    bucket: '',
  }
  • cos 腾讯云配置
  {
    SecretId: '',
    SecretKey: '',
    Bucket: '',
    Region: ''
  }
  • canvas全局水印配置
  {
    text: 'avuejs.com',
    fontFamily: 'microsoft yahei',
    color: "#999",
    fontSize: 16,
    opacity: 100,
    bottom: 10,
    right: 10,
    ratio: 1
  }
Last Updated:
Contributors: smallwei
您正在浏览基于Avue 3.x文档; 点击这里 查看Avue 2.x 的文档