1.0.2 • Published 2 years ago

vue-amis-editor v1.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

vue-amis-editor

version language last stars

Installation

yarn add vue-amis-editor --save

Quick Start

Serve.vue

import VueAmisEditor from 'vue-amis-editor'
export default Vue.extend({
  name: 'ServeDev',
  components: {
    VueAmisEditor,
  },
  data() {
    return {
      preview: true,
      schema: {
        type: 'tasks',
        name: 'tasks',
        items: [
          {
            label: 'hive 任务',
            key: 'hive',
            status: 4,
            remark: '查看详情<a target="_blank" href="http://www.baidu.com">日志</a>。',
          },
          {
            label: '小流量',
            key: 'partial',
            status: 4,
          },
          {
            label: '全量',
            key: 'full',
            status: 4,
          },
        ],
        id: 'u:5f649ab86d6a',
      },
    }
  },
})
</script>
<template>
  <div id="app">
    <vue-amis-editor :is-preview="preview" :value="schema" />
  </div>
</template>

props:

proptypedefaultexplain
isPreviewBooleanfalseWhether it is in preview
isMobileBooleanfalseIs it mobileisMobile
navHeightNumber50Toolbar height
isToolsBooleantrueShow and hide the toolbar
sourcesArray[]video's source link
themeBooleanfalseautoplay when video is loaded
loopBooleanfalseamis theme
toolbarObject{title: 'vue-amis-editor',preview: 'preview',release: 'release',edit: 'edit',obtain: 'obtain',copy: "copy",clear: 'clear',set: "set"}Toolbar configuration, support for internationalization
valueObject{message: 'message'}schemanode
onChangeFunctiononChange(e)amis onChange
obtainFunctionobtainGet the data in the current amis-editor
copyFunctioncopyCopy the data of amis-editor
clearFunctioncleardata for clearamis-editor
getSchemaFunctiongetSchemaGet the data of amis-editor
setSchemaFunctionsetSchema(Schema)set the data of amis-editor
togggeMobileFunctiontogggeMobile(Boolean)Switch between pc and mobile mode
togglePreviewFunctiontogglePreview(Boolean)'Preview and edit mode switching

Online examples