提交 a6ed14e0 编写于 作者: 雪洛's avatar 雪洛

docs: data应为function

上级 354201af
......@@ -89,9 +89,11 @@ const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
export default {
data: {
text: 'uni-app',
voicePath: ''
data() {
return {
text: 'uni-app',
voicePath: ''
}
},
onLoad() {
let self = this;
......
......@@ -51,8 +51,10 @@
```
```javascript
export default {
data: {
src: ''
data() {
return {
src: ''
}
},
methods: {
test: function () {
......@@ -195,8 +197,10 @@ uni.chooseMedia({
```
```javascript
export default {
data: {
src: ''
data() {
return {
src: ''
}
},
methods: {
test: function () {
......
......@@ -120,8 +120,10 @@ var animation = uni.createAnimation({
```javascript
export default{
data: {
animationData: {}
data() {
return {
animationData: {}
}
},
onShow: function(){
var animation = uni.createAnimation({
......
......@@ -51,8 +51,10 @@ index.vue
```javascript
// 仅做示例,实际开发中延时根据需求来使用。
export default {
data: {
text: 'uni-app'
data() {
return {
text: 'uni-app'
}
},
onLoad: function (options) {
setTimeout(function () {
......
......@@ -104,8 +104,10 @@ message|string|失败描述
onLoad() {
},
data: {
fil: [0, 2, 1]
data() {
return {
fil: [0, 2, 1]
}
},
methods: {
......
......@@ -138,8 +138,8 @@ message|string| 具体的网络状态信息
```javascript
<script>
export default {
data: {
fil: true
data() {
return {}
},
onReady() {
// 注意:需要在onReady中 或 onLoad 延时
......
......@@ -379,8 +379,10 @@ BindingX类似一种强化版的css,运行性能高,但没有js那样足够
<script>
const Binding = uni.requireNativePlugin('bindingx');
module.exports = {
data: {
isExpanded: false
data() {
return {
isExpanded: false
}
},
methods: {
getEl: function(el) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册