全量引入

安装

#npm 安装

npm i -S dolphin-weex-ui  或者 npm install dolphin-weex-ui --save

#yarn 安装

yarn add dolphin-weex-ui

#升级组件库

  • 使用 cnpm install -S + 模块name + 版本号,推荐使用cnpm,此处使用npm在部分版本下有问题。
# 升级到最新版本

    cnpm install -S dolphin-weex-ui@latest 

# 升级到指定版本,例如: 

    cnpm install -S dolphin-weex-ui@ + 版本号

# 使用0.0.30版本:

    cnpm install -S dolphin-weex-ui@0.0.30
  • 手动修改package.json文件下的模块的版本号,然后执行以下命令:
cnpm install(推荐)
#或者
npm update 
#或者
npm install

#hello World

<template>
    <div class="app">
        <text>{{title}}</text>
        <dof-button title="快速上手"></dof-button>
    </div>
</template>
<script>
import { DofButton } from 'dolphin-wee-ui'
export default {
    components: {
        DofButton
    },
    data:() => ({
        title: 'hello world'
    })
}
</script>
<style scoped>
.app {
    width: 750px;
}
</style>

注:

如果 npm 安装较慢,可以切换到淘宝源,使用cnpm安装

切换到淘宝镜像:npm config set registry https://registry.npm.taobao.org

posted on 2024-12-12 09:22  AtlasLapetos  阅读(23)  评论(0)    收藏  举报