Skip to content

Commit

Permalink
chore: remove index intro (ElemeFE#19155)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkun authored and CarterLi committed Apr 14, 2020
1 parent 1f984df commit d4f4116
Showing 1 changed file with 1 addition and 50 deletions.
51 changes: 1 addition & 50 deletions examples/pages/template/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -366,40 +366,10 @@
</li>
</ul>
</div>
<div class="theme-intro-a" v-if="showIntroA" @click="hideIntroA">
<div class="intro-banner">
<img src="~examples/assets/images/theme-intro.png" alt="">
<div class="intro-text">
<p><%= 12 ></p>
</div>
</div>
<div class="mask"></div>
</div>
<div
class="theme-intro-b"
@click="hideIntroB"
v-if="showIntroB"
>
<div class="intro-banner"
:style="{
left: introBX + 'px',
top: introBY + 'px'
}"
>
<img src="~examples/assets/images/intro-theme-b.png" alt="">
<div class="title">
<div>
<p><%= 13 ></p>
<p><%= 14 ></p>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { throttle } from 'throttle-debounce';
import { addClass, removeClass } from 'element-ui/src/utils/dom';
export default {
created() {
Expand All @@ -416,38 +386,19 @@
if (calHeight < 0) calHeight = 0;
if (calHeight > eleHeight) calHeight = eleHeight;
this.mainImgOffset = calHeight;
},
hideIntroB() {
removeClass(document.body, 'el-loading-parent--hidden');
localStorage.setItem('KNOW_THEME', 'true');
this.showIntroB = false;
},
hideIntroA() {
const themeTab = document.querySelector('.nav-item-theme');
this.introBX = themeTab.offsetLeft + (themeTab.clientWidth * 0.5) - (300 / 2);
this.introBY = themeTab.offsetTop + 40;
this.showIntroA = false;
this.showIntroB = true;
}
},
data() {
return {
lang: this.$route.meta.lang,
mainImgOffset: 0,
showIntroA: false,
showIntroB: false,
introBY: 0,
introBX: 0
mainImgOffset: 0
};
},
beforeDestroy() {
window.removeEventListener('scroll', this.throttledHandleScroll);
},
mounted() {
window.addEventListener('scroll', this.throttledHandleScroll);
if (localStorage.getItem('KNOW_THEME')) return;
this.showIntroA = true;
addClass(document.body, 'el-loading-parent--hidden');
}
};
</script>

0 comments on commit d4f4116

Please sign in to comment.