$(document).ready(function () { $( ".fancybox").fancybox(); }); new Vue({ el: '#app', data() { return { keyword: '', fullscreenLoading: false, videoUrl: '', successShow: false, successMessage: '', needRefresh: false, message:'', renovate:'', type:'', msg:'' } }, created() {}, updated() {}, methods: { doPost() { var that = this; that.fullscreenLoading = true; var $url = encodeURIComponent(that.keyword); axios.post('jx.php?url='+$url+'&key=b7d2180b3dfa71aa514c2e3920ce0eaa') .then(function (response) { that.successShow= false; that.fullscreenLoading = false; console.log(response.data); if (response.status == 200) { that.successShow = true; that.name = response.data.message.name; that.videoUrl = response.data.message.video_url; that.successMessage = response.data.message.image_url; that.downUrl = response.data.message.down_url; that.image_down = response.data.message.image_down; that.type = response.data.message.type; that.msg = response.data.message.msg; that.message = response.data.message; that.renovate = response.data.renovate; that.needRefresh = false; } else { that.$message.error(response.data.msg); } }) . catch(function (error) { console.log(error) that.$message.error('解析失败!'); }); }, clear() { this.keyword = ''; this.successShow = false }, onCopySuccess(e) { this.$message({ message: '复制成功!', type: 'success' }); }, onCopyError(e) { this.$message.error('复制失败!'); } } });