如何解决在vue中替换图片、一个使用base64,而我们使用zepto之后,src找不到资源,因为已经打包了,难道强行写base64。
1. 引入文件时语法很重要!
import "FooterMenu" from '@components/Menu';
import FooterMenu from '@components/Menu';
即在页面组件中引入一个FooterMenu组件, 我们引入时应该引入的一个变量作为标签,而不能再FooterMenu上添加引号!! 在这里浪费了很多时间。
2. 在一个单页面组件中不需要style,但必须要script。
即在.vue文件中,我们可以没有style,但是必须要有script来利用 exports default 来导出模块,否则就会出错。
补充:
<transition name="fade">
<div class="pay-model" v-show="ifpay">
<div class="pay-style">
<div v-if="payArr[payArr.length - 3] == 1">
<input type="radio" name="settleChoose" checked = "checked" data-value='4' id="wechat" value="微信支付" v-model="style">
<label for="wechat" >微信支付</label>
</div>
<div v-if="payArr[payArr.length - 2] == 1">
<input type="radio" name="settleChoose" id="alipay" data-value='2' value="支付宝支付" v-model='style'>
<label for="alipay" >支付宝支付</label>
</div>
<div v-if="payArr[payArr.length - 1] == 1">
<input type="radio" name="settleChoose" id="tohome" data-value='1' value="货到付款" v-model='style'>
<label for="tohome">货到付款</label>
</div>
</div>
</div>
</transition>
在这里,如果style的值为初始值 "", 即为空,那么我们及时使用这里的checked = "checked"也无法自动选中,解决方法:如果我们希望在打开模态框之后的微信支付是默认的,那么我们就可以将 style 的初始值设置为 “微信支付”, 这样就没有什么问题了。
补充:
?1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <div v- if = "payArr[payArr.length - 2] == 1" > <label class = "pay-lable" > <input type= "radio" v-bind: checked = |