vue实现把数据渲染到下拉框中,点击其中一个数据,后面接上文本

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="//cdn.bootcss.com/vue/2.5.2/vue.min.js"></script>
</head>
<body>
    <div id="app">
			<select v-model="selected">
            <option v-for="option in optionds"  v-bind:value="option.spell">{{option.name}}</option>
        </select>
        <textarea>{{selected}}</textarea>
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                hulusi: [],
                selected: "",
                optionds: [
                    {
                        id: 1,
                        name: '大娃',
                        spell: '力大无穷'
                    },
                    {
                        id: 1,
                        name: '二娃',
                        spell: '千里眼'
                    },
                    {
                        id: 1,
                        name: '三娃',
                        spell: '顺风耳'
                    },
                ]
            },
        })

    </script>
</body>
</html>

上一篇:ZipKin的原理的介绍


下一篇:H5跳转到小程序wx-open-launch-weapp