// html
<div id="app">
<div id="c"></div>
</div>
<script id="tpl" type="text/template">
<div style="display: inline-block;">
<input type="radio" name="payway" v-model="payway" value="wx"/>
<input type="radio" name="payway" v-model="payway" value="zfb"/>
</div>
</script>
// js
new Vue({
el: "-sharpapp",
data: {
payway: "wx"
},
mounted: function(){
$("-sharpc").html($("-sharptpl").html())
}
})
radio(data)
- the generated things are not bound to the value, so how can the html generated by jquery be bound to the value?
- or should not do this, but should do it with components? But how do components implement?
add: actually my code uses a pop-up plug-in http://layer.layui.com/
layer.open({
type: 1,
skin: "layui-layer-rim", //
area: ["500px", "500px"], //
content: $("-sharppaytpl").html() // <script type="text/template">,vuedata
});
// content: html //htmlhtml vue