Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/367.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在Vue js中向函数中输入变量_Javascript_Html_Vue.js - Fatal编程技术网

Javascript 如何在Vue js中向函数中输入变量

Javascript 如何在Vue js中向函数中输入变量,javascript,html,vue.js,Javascript,Html,Vue.js,Vue脚本: :style="{ '-webkit-animation-delay': content * 0.2 + 's' }" 新Vue({ el:“.container”, 数据:{ 反弹:错, 内容:[ {title:'title first',message:'message first'}, {title:'title second',message:'message second'}, {title:'title third',message:'message third'}

Vue脚本:

:style="{ '-webkit-animation-delay': content * 0.2 + 's' }"

新Vue({
el:“.container”,
数据:{
反弹:错,
内容:[
{title:'title first',message:'message first'},
{title:'title second',message:'message second'},
{title:'title third',message:'message third'}
]
}
})  

然后

v-for="(content, index) in contents"

检查第二个示例

嗨!你能详细解释一下“但它不起作用”吗?发生了什么,还是没有发生?控制台错误?
<script>
new Vue({
  el: '.container',
  data: {
    bounce: false,
    contents: [
      { title: 'title first', message: 'message first' },
      { title: 'title second', message: 'message second' },
      { title: 'title third', message: 'message third' }
    ]
  }
})  
v-for="(content, index) in contents"
:style="{ '-webkit-animation-delay': (index+1) * 0.2 + 's' }"