12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import Vue from 'vue'
- import Rules from './rules.vue'
- import i18n from '@/util/lang/lang'
- const RulesConstructor = Vue.extend(Rules)
- Rules.install = function (Vue) {
- // Vue.component(Rules.name, Rules);
- }
- let instance
- Rules.show = (title, content) => {
- if (!instance) {
- instance = new RulesConstructor({
- el: document.createElement('div'),
- data () {
- return {
- visible: true,
- showTitle: title,
- showContent: content
- }
- },
- i18n
- })
- document.body.appendChild(instance.$el)
- } else {
- instance.visible = true
- instance.showTitle = title
- instance.showContent = content
- }
- }
- /**
- * 显示游戏规则
- */
- Rules.showRules = () => {
- Rules.show('title1', 'content1')
- }
- /**
- * 显示GT规则
- */
- Rules.showGTRules = () => {
- Rules.show('title2', 'content2')
- }
- /**
- * 显示充值说明
- */
- Rules.showIntroRules = () => {
- Rules.show('title3', 'content3')
- }
- Rules.hide = () => {
- if (instance) {
- instance.visible = false
- }
- }
- export default Rules
|