weex 小结
2024-10-20 05:48:10
1. import 文件时,必须引入全称,不能省略 .vue
import mEcharts from '../components/Echarts.vue'
2.weex 的 cli 中没有 配置 vue-router 和 less 需要自己安装
npm install vue-router --save
npm install less less-loader --save
3.安装 node-sass 时,需要同时安装 sass-loader
安装 node-sass
npm install --save node-sass --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist --sass-binary-site=http://npm.taobao.org/mirrors/node-sass
安装 sass-loader
npm install sass-loader --save
4.css样式 不支持缩写
例如:
border: 1px solid #eee;
需要改为:
border-width: 1px;
border-style: solid;
border-color: #eee;
5.图片名称 不能有 ' _ '
例如:
ic_tab_home_normal.png 或 01.png
需要改成:
icTabHomeNormal.png
最后发现,需要 安装 url-loader 插件
npm i url-loader -S
配置 webpack.dev.js
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader'
}
6.[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
配置: webpack.config.js
resolve: {
alias: {
'vue': 'vue/dist/vue.js'
}
}
7.<image></image> 无法读取本地图片,官方解释是 减小打包后的 apk 文件的体积,当用户首次安装后,会从网上将图片缓存至本地。
正确用法:
<image class="input-img" src="http://192.168.1.208:8081/src/assets/img/user.png"></image>
8.在 Weex 中,我们只支持 px
长度单位。并且它将在 JavaScript 运行时和本机渲染器中解析为数字类型。
.
最新文章
- 160809212田京诚C语言程序设计实验2 选择结构程序设计_进阶
- openfalcon客户端自定义push 传输到transfer
- Head First 设计模式 --8 模板方法模式 别找我,我会找你
- 基于WDF的PCI/PCIe接口卡Windows驱动程序(4)- 驱动程序代码(源文件)
- app_field.clear_dependent_fields
- Javascript 思维导图
- IWorkspaceFactory接口
- Asp.net容器化
- JVM-Ubuntu18.04.1下编译OpenJDK8
- Oracle 数据库监听配置和服务
- 十六、springcloud(二)Eureka集群
- Linux shell逐行读取文件的方法
- MySQL高可用架构-MHA环境部署记录
- angular上传获取图片的directive指令
- JDBC连接数据库,结合DbUtil数据库连接工具类的使用
- CS229 6.11 Neurons Networks implements of self-taught learning
- Struts2 调用非execute方法
- 什么是anaconda【转载】
- .net asp [转载]ASP:循环滚动图片的代码+解释
- javascript的执行机制—Event Loop