提交 22511709 编写于 作者: richard_1015's avatar richard_1015

Merge branch 'next' of https://github.com/jdf2e/nutui into next

...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
<div class="text-data">我是测试数据22</div> <div class="text-data">我是测试数据22</div>
<div class="text-data">我是测试数据23</div> <div class="text-data">我是测试数据23</div>
<div class="text-data">我是测试数据24</div> <div class="text-data">我是测试数据24</div>
<nut-backtop @click="handleClick" elId="elId" :distance="100" :bottom="90"><view></view></nut-backtop> <nut-backtop @click="handleClick" elId="elId" :distance="100" :bottom="90"
><view></view></nut-backtop
>
<nut-backtop @click="handleClick" elId="elId" :distance="200"></nut-backtop> <nut-backtop @click="handleClick" elId="elId" :distance="200"></nut-backtop>
</div> </div>
</template> </template>
......
...@@ -68,7 +68,8 @@ export default create({ ...@@ -68,7 +68,8 @@ export default create({
//滚动条偏移量 //滚动条偏移量
//Window //Window
if (scrollEl instanceof Window) { if (scrollEl instanceof Window) {
const scrollTop = scrollEl.pageYOffset !== undefined ? scrollEl.pageYOffset : ''; const scrollTop =
scrollEl.pageYOffset !== undefined ? scrollEl.pageYOffset : '';
backTop.value = scrollTop >= props.distance; backTop.value = scrollTop >= props.distance;
//DOM //DOM
} else if (scrollEl instanceof HTMLElement) { } else if (scrollEl instanceof HTMLElement) {
......
...@@ -10,24 +10,24 @@ ...@@ -10,24 +10,24 @@
<div class="nav-box"> <div class="nav-box">
<ul class="nav-list"> <ul class="nav-list">
<li class="nav-item" :class="{ active: isActive(header[0].name) }"> <li class="nav-item" :class="{ active: isActive(header[0].name) }">
<router-link :to="header[0].name">{{ <router-link :to="header[0].name">
header[0].cName {{ header[0].cName }}
}}</router-link> </router-link>
</li> </li>
<li class="nav-item" :class="{ active: isActive(header[1].name) }"> <li class="nav-item" :class="{ active: isActive(header[1].name) }">
<router-link :to="header[1].name">{{ <router-link :to="header[1].name">
header[1].cName {{ header[1].cName }}
}}</router-link> </router-link>
</li>
<li class="nav-item" :class="{ active: isActive(header[2].name) }">
<a href="http://localhost:8080/demo.html#/">
{{ header[2].cName }}
</a>
</li> </li>
<li class="nav-item" :class="{ active: isActive(header[2].name) }"
><a href="http://localhost:8080/demo.html#/">{{
header[2].cName
}}</a></li
>
<li class="nav-item" :class="{ active: isActive(header[3].name) }"> <li class="nav-item" :class="{ active: isActive(header[3].name) }">
<router-link :to="header[3].name">{{ <router-link :to="header[3].name">
header[3].cName {{ header[3].cName }}
}}</router-link> </router-link>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<div <div
...@@ -234,7 +234,7 @@ export default defineComponent({ ...@@ -234,7 +234,7 @@ export default defineComponent({
height: 26px; height: 26px;
vertical-align: middle; vertical-align: middle;
background: url('../../assets/images/icon-user.png') no-repeat; background: url('../../assets/images/icon-user.png') no-repeat;
background-size: 100%; background-size: 26px;
} }
} }
} }
...@@ -322,6 +322,9 @@ export default defineComponent({ ...@@ -322,6 +322,9 @@ export default defineComponent({
} }
.user-link { .user-link {
background-position: 0 0; background-position: 0 0;
// &:hover {
// background-position: -26px 0;
// }
} }
} }
} }
...@@ -397,7 +400,10 @@ export default defineComponent({ ...@@ -397,7 +400,10 @@ export default defineComponent({
} }
} }
.user-link { .user-link {
background-position: 0 -26px; background-position: 0 -25px;
// &:hover {
// background-position: -26px -25px;
// }
} }
} }
} }
...@@ -473,7 +479,10 @@ export default defineComponent({ ...@@ -473,7 +479,10 @@ export default defineComponent({
} }
} }
.user-link { .user-link {
background-position: 0 -52px; background-position: 0 -51px;
// &:hover {
// background-position: -26px -51px;
// }
} }
} }
} }
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
{{ item.name }} {{ item.name }}
<span>{{ item.cName }}</span> <span>{{ item.cName }}</span>
</router-link> </router-link>
<!-- <router-link v-if="!_package.isLink" :to="_package.name.toLowerCase()">{{ _package.cName }}</router-link> -->
</li> </li>
</ul> </ul>
</div> </div>
...@@ -57,7 +56,6 @@ export default defineComponent({ ...@@ -57,7 +56,6 @@ export default defineComponent({
watch( watch(
() => data.searchVal, () => data.searchVal,
sVal => { sVal => {
console.log(sVal, '改变');
if (sVal) { if (sVal) {
data.searchList = data.navList.filter(item => { data.searchList = data.navList.filter(item => {
if (item.show === false) return false; if (item.show === false) return false;
...@@ -83,11 +81,38 @@ export default defineComponent({ ...@@ -83,11 +81,38 @@ export default defineComponent({
data.searchVal = ''; data.searchVal = '';
}, 200); }, 200);
}; };
const checklist = item => { const checklist = () => {
console.log(1); data.searchVal = '';
data.searchCurName = '';
data.searchIndex = 0;
}; };
const choseList = e => { const choseList = e => {
data.searchIndex = 0; let searchIndex = data.searchIndex;
if (e.keyCode == 40) {
searchIndex++;
}
if (e.keyCode == 38) {
searchIndex--;
}
if (searchIndex < 0) {
searchIndex = 0;
}
const searchList = data.searchList;
if (searchList.length > 0) {
const cName = searchList[searchIndex] && searchList[searchIndex].name;
if (cName) {
data.searchCurName = cName;
data.searchIndex = searchIndex;
if (e.keyCode == 13) {
data.$router.push({
path: '/' + searchList[searchIndex].name
});
data.searchCurName = '';
data.searchIndex = 0;
data.searchVal = '';
}
}
}
}; };
return { return {
data, data,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</div> </div>
<!-- 设计资源 --> <!-- 设计资源 -->
<div class="resource-content"> <div class="resource-content">
<div class="resource-block" v-if="data.articleList.length === 0"> <div class="resource-block" v-if="articleList.length === 0">
<h4 class="sub-title">设计资源</h4> <h4 class="sub-title">设计资源</h4>
<p class="sub-desc" <p class="sub-desc"
>这里提供 NUT UI >这里提供 NUT UI
...@@ -33,18 +33,18 @@ ...@@ -33,18 +33,18 @@
<div class="tab-hd"> <div class="tab-hd">
<div <div
class="tab-hd-item" class="tab-hd-item"
:class="{ active: data.activeIndex === index }" :class="{ active: activeIndex === index }"
v-for="(item, index) in data.tabData" v-for="(item, index) in tabData"
:key="index" :key="index"
@click="clickTab(index)" @click="clickTab(index)"
> >
{{ item.title }} {{ item.title }}
</div> </div>
</div> </div>
<div class="tab-bd" v-show="data.activeIndex === 0"> <div class="tab-bd" v-show="activeIndex === 0">
<div <div
class="design-item" class="design-item"
v-for="item in data.articleList" v-for="item in articleList"
:key="item.id" :key="item.id"
@click="toLink(item.id)" @click="toLink(item.id)"
> >
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<p class="design-title">{{ item.title }}</p> <p class="design-title">{{ item.title }}</p>
</div> </div>
</div> </div>
<div class="tab-bd" v-show="data.activeIndex === 1"> <div class="tab-bd" v-show="activeIndex === 1">
<div class="design-item"> <div class="design-item">
<img class="img-design" src="../../assets/images/img-article.jpg" /> <img class="img-design" src="../../assets/images/img-article.jpg" />
<p class="design-title" <p class="design-title"
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<doc-footer></doc-footer> <doc-footer></doc-footer>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, onMounted, reactive } from 'vue'; import { defineComponent, onMounted, reactive, toRefs } from 'vue';
import { import {
onBeforeRouteUpdate, onBeforeRouteUpdate,
RouteLocationNormalized, RouteLocationNormalized,
...@@ -116,12 +116,6 @@ export default defineComponent({ ...@@ -116,12 +116,6 @@ export default defineComponent({
tabData: [ tabData: [
{ {
title: '全部文章' title: '全部文章'
},
{
title: '性能体验'
},
{
title: '性能体验1'
} }
// { // {
// title: '性能体验' // title: '性能体验'
...@@ -158,7 +152,7 @@ export default defineComponent({ ...@@ -158,7 +152,7 @@ export default defineComponent({
window.open('//jelly.jd.com/article/' + id); window.open('//jelly.jd.com/article/' + id);
}; };
return { return {
data, ...toRefs(data),
clickTab, clickTab,
toLink toLink
}; };
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册