1.0.2 • Published 1 year ago

fortune-activity-editor-components v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

活动中心组件库

为在编辑器和 H5 页面中复用,独立出来的业务组件库

该组件包导出两种格式的模块,供不同情况下使用

  // umd 格式
  "main": "dist/activity-components.umd.js",
  // es modules 格式
  "module": "dist/activity-components.esm.js",

安装和使用

// 安装
npm install activity-components --save
import ActivityComponents from 'activity-components'
// 加载样式
import 'activity-components/dist/activity-components.css'

const app = createApp(App)
// 全局引入 目前包括 FinalPage, LText, LArea , LModal四个组件
app.use(ActivityComponents)

app.mount('#app')

渲染最终页面

setup() {
  // 使用 finalPage 组件进行渲染,使用预定义好的数据结构
  const testData = {
    components: [
      // TODO 属性
      {id: '123', name: 'l-text', props: { text: 'hello', top: '0', left: '20px'}},
      {id: '234', name: 'l-area', props: { imageSrc: 'http://vue-maker.oss-cn-hangzhou.aliyuncs.com/vue-marker/5f6338e666336111f73d220c.png', top: '30px', left: '20px'}},
      {id: '235', name: 'l-modal', props: { backgroundColor: 'red', top: '50px', left: '20px', width: '100px', height: '100px'}},
      {id: '345', name: 'l-text', props: { backgroundColor: "#1890ff", color: "#ffffff", text: "按钮内容",  width: "100px", actionType: "to", url: "http://www.baidu.com", top: '200px', left: '150px',
      }}
    ]
  }
  return {
    testData
  }
}
<final-page :components="testData.components"></final-page>
1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago