我有这个是为了得到userType
<?php echo $userType = $_GET['user_type']?>;我想将$userType初始化为Vue varibale,如下所示,或者使用任何简单的方法
var ArtificialInsemination = new Vue({
el:'#ArtificialInsemination',
data: {
url:'http://localhost/dairyweb/dairyfarm/index.php',
artificialInseminationRecords: [],
cowId: '',
aiNo: '',
sessession:'',
user:$userType
},发布于 2017-11-05 15:12:23
在Vue中,你可以像这样抓取url参数:
this.$route.query.user_type假设您的url是这样的:
http:://example.com?user_type=exampletype我还假设您需要导入vuerouter,但我不能百分之百确定。
https://stackoverflow.com/questions/47118968
复制相似问题