Commit 9d5f6a2d by limin

Merge branch 'master' of http://192.168.3.233:8090/npm/glsx-components into master

2 parents 4ab79b62 04e5aa31
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
{
"name": "glsx-components",
"description": "glsx vue components",
"version": "1.0.3",
"version": "1.0.7",
"author": "limin <17653212@qq.com>",
"license": "MIT",
"main": "dist/glsx-components.common.js",
......
......@@ -3,53 +3,53 @@
</template>
<script>
import { Postmate } from "glsx-common";
import { Postmate } from 'glsx-common'
export default {
name: "GLExternal",
name: 'GLExternal',
props: {
url: {
type: String,
required: true,
required: true
},
subscribe: {
type: Function,
default: null,
},
default: null
}
},
data() {
return {
container: null,
};
container: null
}
},
mounted() {
this.container = this.$refs["adapter-frame"];
this.create();
this.container = this.$refs['adapter-frame']
this.create()
},
methods: {
create() {
if (!this.url) throw new Error("url为空");
this.container.innerHTML = "";
if (!this.url) throw new Error('url为空')
this.container.innerHTML = ''
var postmate = new Postmate({
container: this.container,
url: this.url,
name: "adapter-frame",
classListArray: ["gl-external-adapter-frame"],
name: 'adapter-frame',
classListArray: ['gl-external-adapter-frame']
})
.then((child) => {
child.get("height").then((height) => {
child.frame.setAttribute("scrolling", "no");
child.frame.style.height = `${height+14}px`;
});
this.subscribe && this.subscribe(child);
.then(child => {
child.get('height').then(height => {
child.frame.setAttribute('scrolling', 'no')
child.frame.style.height = `${height + 14}px`
})
this.subscribe && this.subscribe(child)
})
.catch((err) => {
console.log(err);
throw new Error("连接失败: " + this.url);
});
},
},
};
.catch(err => {
console.log(err)
throw new Error('连接失败: ' + this.url)
})
}
}
}
</script>
<style>
.gl-external-adapter-frame {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!