实现加载一个地址请求和跳转的同时动作
<script>
import CustomInput from './CustomInput.vue'
export default {
components: { CustomInput },
data() {
return {
url: 'https://www.baidu.com'
}
},
methods: {
load() {
url = this.url;
},
},
}
</script>
<template>
<CustomInput v-model="url" /> {{url}}
<a v-bind:href="url">SoSo</a>
</template>
<script>
export default {
props: ['modelValue'],
emits: ['update:modelValue']
}
</script>
<template>
<input
:value="modelValue"
@input="$emit('update:modelValue', $event.target.value)"
/>
<a @click="load"> {{url}} </a>
</template>
标签:default,VUE,鸡汤,url,笔记,CustomInput,export,modelValue
From: https://www.cnblogs.com/qianxiaoruofeng/p/16740136.html