Browse Source

调接口

20-plugin-information
aBin 4 years ago
parent
commit
96f265ddf6
  1. 20
      index.html

20
index.html

@ -51,19 +51,21 @@
<script>
const p1419896043390377984 = {
dom: '',
init() {
var dom = document.querySelector("div[data-root=p1419896043390377984]");
var domBox = dom.parentNode;
var title = dom.querySelector('.title');
this.dom = document.querySelector("div[data-root=p1419896043390377984]");
var domBox = this.dom.parentNode;
var title = this.dom.querySelector('.title');
title.innerHTML = domBox.getAttribute('data-tname')
},
// 跳转详情
jumpDetails(that) {
const pId = that.parentNode.parentNode.getAttribute('data-pid');
const rId = that.parentNode.parentNode.getAttribute('data-rid');
const uId = that.parentNode.parentNode.getAttribute('data-uid');
const tId = that.parentNode.parentNode.getAttribute('data-tid');
const pId = this.dom.parentNode.getAttribute('data-pid');
const rId = this.dom.parentNode.getAttribute('data-rid');
const uId = this.dom.parentNode.getAttribute('data-uid');
const tId = this.dom.parentNode.getAttribute('data-tid');
location.href = 'https://www.kdocs.cn/l/cpcTuiekDTNm';
}
}
@ -102,10 +104,10 @@
<!-- 示例插件1-->
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="alert('hello')">测试组建1</button>
<!-- 示例插件2 id=100-->
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="p100.show()">测试组建2</button>
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="p200.show()">测试组建2</button>
<script>
const p100 = {
const p200 = {
name: 'hello tall plugin',
show() {
alert(this.name)

Loading…
Cancel
Save