// ==UserScript== // @name 孤独狂饮Test_VUE // @namespace [url=mailto:741227905@qq.com]741227905@qq.com[/url] // @version 0.2 // @description 本脚本自带 VUE 和 element-ui 属性,可以更方便的添加各种功能 // @author gdky005 // @match *://www.80s.tw/* // @require https://unpkg.com/vue/dist/vue.js // @require https://unpkg.com/element-ui/lib/index.js // @grant GM_addStyle // @grant GM_getValue // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Your code here... var header_link = ''; //将以上拼接的html代码插入到网页里的ul标签中 var header_link_tag = $("head"); if (header_link_tag) { header_link_tag.append(header_link); } var vue_code = '
' vue_code+='{{ message }}' vue_code+='' vue_code+='订阅按钮' vue_code+='' vue_code+='' vue_code+='{{ dialogText }}' vue_code+='' vue_code+='取 消' vue_code+='确 定' vue_code+='' vue_code+='' vue_code+='
' var ul_tag = $("div.img"); if (ul_tag) { ul_tag.append(vue_code); }; new Vue({ el: '#app', data: function () { return { message: "", dialogText: "是否真的要订阅?", dialogVisible: false, centerDialogVisible: false } }, methods: { handleClose(done) { this.$confirm('确认关闭?') .then(_ => { done(); }).catch(_ => {}); }, btnOnClick() { this.centerDialogVisible = true; var url = document.URL; var name = $("h1.font14w")[0].innerText; var id = url.substring(url.lastIndexOf("/") + 1, url.length); var msg = "url 是:" + url + ",\n名字:" + name + ",\nid:" + id; console.log(msg); this.dialogText = msg; }, requestData() { this.centerDialogVisible = false; } } }) //var down_btn_html = ''; //将以上拼接的html代码插入到网页里的ul标签中 //var ul_tag = $("div.info>h1"); //if (ul_tag) { // ul_tag.append(down_btn_html); //}; })();