weex APIs
Posted L先森
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了weex APIs相关的知识,希望对你有一定的参考价值。
1.通过这个$vm()上下文访问这些api在脚本的方法
<script> module.exports = { methods: { somemethod: function() { this.$vm(‘someId‘); } } } </script>
1.1 $(id)
已过时, 使用 $vm
.
1.2 $el(id)
返回元素引用的特定的id
1.3 $getConfig()
获取当前全局环境变量和配置信息
config
(object): the object of config.bundleUrl
(string): the url of bundle.debug
(boolean): if is debug mode.env
(object): a object of envrioment.weexVersion
(string): a version of weex sdk.appName
(string): a name of app.appVersion
(string): a version of app.platform
(string): the platform, one ofios
,android
andWeb
.osVersion
(string): the version of os.deviceModel
(string): the model of device. native onlydeviceWidth
(number): the width of device, default is750
.deviceHeight
(number): the height of device.
以上是关于weex APIs的主要内容,如果未能解决你的问题,请参考以下文章