当前位置: 首页 > news >正文

网站建设的实训心得专业地推团队电话

网站建设的实训心得,专业地推团队电话,wordpress cms 模板制作,吉林市教做网站内容 绘制了主页的基本布局设置了封装了header栏组件并设置了全局黑夜模式. 选择一个组件库-Naive UI 如果没有设计能力,又想开发出风格统一的前端页面。就一定要选择一个漂亮的组件库。 本次项目选择使用Naive UI,NaivUI库曾被Vue框架作者尤雨溪推荐…

内容

  1. 绘制了主页的基本布局
  2. 设置了封装了header栏组件并设置了全局黑夜模式.

选择一个组件库-Naive UI

如果没有设计能力,又想开发出风格统一的前端页面。就一定要选择一个漂亮的组件库。
本次项目选择使用Naive UI,NaivUI库曾被Vue框架作者尤雨溪推荐,库作者松若章的设计和风格,我也非常喜欢。
在这里插入图片描述

规划布局

一个好看的主页是什么样的呢?
给大家列举一下我参考的部分网站主页
Naive UI
Vue.js 渐进式JavaScript 框架
React 用于构建用户界面的 JavaScript 库
Insgram
Scott Hanselman

大牛的网站主页往往很简单甚至粗糙,但许多库的官网都很漂亮。两者有一个相同点,就是简单统一的风格给人以大气干净的高级感。。
索性我们就参考vue3项目创建的初始布局,利用nativeUI来编写主页。
在这里插入图片描述
抽象来看就是这样。但要注意的是Content的内容应该由vue router控制。并且添加NConfigProvider来提供黑夜模式,细节详细见代码。在这里插入图片描述

编写代码

App.vue

选用Native UI中的Layout组件帮助布局

//App.vue
<script setup>
//导入vue-Router组件
import { RouterView } from 'vue-router'
//导入NLayout组件
import {NConfigProvider,NLayoutHeader,NLayoutContent,} from 'naive-ui'

App.vue


<template><n-config-provider ><n-layout style="min-height:100vh;"><n-layout-header bordered="true"></n-layout-header><n-layout-content >    <RouterView /></n-layout-content></n-layout></n-config-provider>
</template>

此时路由指向的是HomeView,所以让我继续修改HomeView

HomeView.vue

<script setup>import {NSpace,} from 'naive-ui'import ContentLeft from './homeview/ContentLeft.vue';import ContentRight from './homeview/ContentRight.vue';</script>
<template><n-space style="height: 100%;" justify="center" size="large"align="center"><content-left/><content-right/></n-space>
</template>

依照导入路径创建ContentLeft.vue与ContentRight.vue文件。

ContentLeft.vue 和 ContentRight.vue

关于ContentLeft.vue和ContentRight.vue 参考vue 初识页面,作如下设计

ContentLeft.vue
<script setup>import {NSpace,NGradientText,} from 'naive-ui'import {ref} from 'vue'
import router from '../../router';let quote = ref(null)quote.value = ["君子终日乾乾","夕惕若,厉,无咎"]function jumpToBlogs(){router.push("/articles")}
</script>
<template><n-space verticalstyle="height: 100%;"align="center"justify="center" ><n-gradient-text v-for="line in quote"type="danger" style="font-size: 2.3rem;">{{ line }}</n-gradient-text><n-button type="primary" @click="jumpToBlogs">开始阅读</n-button></n-space>
</template>
ContentRight.vue
<script setup>import {NTimeline,NTimelineItem,} from 'naive-ui'import {ref} from 'vue'const last_blogs = ref(null);last_blogs.value = [{title:"Linus Torvalds 怒怼:不要提交没有注释的请求",content:"Linux 6.3 合并窗口期已经于近日开启,Linus Torvalds 收到了大量的 pull request(PR)请求,总体来看,本次窗口期的各项工作开展顺利.",time:"2023-02-23 09:30:54",},{title:"titletses",content:"哪里成功",time:"2018-04-03 20:46"},{title:"成功",content:"哪里成功",time:"2018-04-03 20:46"},]
</script>
<template><n-timeline><n-timeline-itemv-for="blog in last_blogs"type="success":title=blog.title:content=blog.content:time=blog.timestyle="max-width: 50vw;"/></n-timeline>
</template>

Top.vue与黑夜模式

封装一下Top.vue以实现黑夜模式。

<script setup>import {NSpace,NSwitch} from 'naive-ui'const props = defineProps(['active'])const emit = defineEmits(['update:active'])const active = computed({get(){return props.active;},set(active){emit('update:active', active) }})</script>

Props即传入的参数,emit即当改变发生时,提交给父组件。这样就完成了父子组件的双向绑定声明。
最后设置参数active的get()参数获取porps中active的值,set()方法设定返回给父组件的确切值即可。

<template><n-space style="width: 100%;margin-inline: 2vw;"justify="space-between"align="center"><div style="font-weight:700;">Blog</div><n-switch v-model:value="active" size="large"></n-switch></n-space>
</template>

使用Top.vue
App.vue

import Top from './views/homeview/Top.vue';
import {ref,computed} from 'vue'
import {darkTheme,NLayout,NLayoutHeader,NLayoutContent,NConfigProvider} from 'naive-ui'
let active = ref(false)
const theme = computed(()=>{return active.value? darkTheme:null;
})
<template><n-config-provider :theme="theme" style="min-height:100vh;"><n-layout style="min-height:100vh;"><n-layout-header class="top flex-row-box"bordered="true"><top v-model:active="active"></top></n-layout-header>......

最终效果:
在这里插入图片描述
在这里插入图片描述


文章转载自:
http://theileriasis.nrpp.cn
http://hyla.nrpp.cn
http://lille.nrpp.cn
http://shahaptan.nrpp.cn
http://alif.nrpp.cn
http://vellicate.nrpp.cn
http://ocellus.nrpp.cn
http://introrse.nrpp.cn
http://nonvocoid.nrpp.cn
http://chieftain.nrpp.cn
http://respectability.nrpp.cn
http://bumph.nrpp.cn
http://millirad.nrpp.cn
http://plagiarise.nrpp.cn
http://adelantado.nrpp.cn
http://worsen.nrpp.cn
http://hum.nrpp.cn
http://fusibility.nrpp.cn
http://diversity.nrpp.cn
http://exhibitively.nrpp.cn
http://sherwani.nrpp.cn
http://primigravida.nrpp.cn
http://carrageenan.nrpp.cn
http://pelvimeter.nrpp.cn
http://stereo.nrpp.cn
http://tannoy.nrpp.cn
http://frequent.nrpp.cn
http://pergunnah.nrpp.cn
http://younker.nrpp.cn
http://teether.nrpp.cn
http://clearstory.nrpp.cn
http://hookup.nrpp.cn
http://maloti.nrpp.cn
http://porker.nrpp.cn
http://fornix.nrpp.cn
http://strategos.nrpp.cn
http://suppressive.nrpp.cn
http://dilatoriness.nrpp.cn
http://malpais.nrpp.cn
http://unshirkable.nrpp.cn
http://booze.nrpp.cn
http://futurist.nrpp.cn
http://equalitarian.nrpp.cn
http://tumbledown.nrpp.cn
http://phylloerythrin.nrpp.cn
http://falsetto.nrpp.cn
http://arthral.nrpp.cn
http://frustrated.nrpp.cn
http://reapplication.nrpp.cn
http://astigmatic.nrpp.cn
http://colossus.nrpp.cn
http://undesigned.nrpp.cn
http://quod.nrpp.cn
http://wingspread.nrpp.cn
http://resection.nrpp.cn
http://cainite.nrpp.cn
http://helilift.nrpp.cn
http://pedicel.nrpp.cn
http://dismally.nrpp.cn
http://minstrel.nrpp.cn
http://sanitation.nrpp.cn
http://outrival.nrpp.cn
http://spiritually.nrpp.cn
http://oceanographer.nrpp.cn
http://enrico.nrpp.cn
http://tania.nrpp.cn
http://iodine.nrpp.cn
http://lubricator.nrpp.cn
http://iraqi.nrpp.cn
http://rancidness.nrpp.cn
http://ciborium.nrpp.cn
http://poole.nrpp.cn
http://monostichous.nrpp.cn
http://lincrusta.nrpp.cn
http://towaway.nrpp.cn
http://unsuspectingly.nrpp.cn
http://elocution.nrpp.cn
http://pinchers.nrpp.cn
http://recitativo.nrpp.cn
http://sundial.nrpp.cn
http://neuropsychiatry.nrpp.cn
http://humiliation.nrpp.cn
http://committeewoman.nrpp.cn
http://achromatize.nrpp.cn
http://perrier.nrpp.cn
http://everglade.nrpp.cn
http://dinosaurian.nrpp.cn
http://denticare.nrpp.cn
http://monte.nrpp.cn
http://bans.nrpp.cn
http://hunkers.nrpp.cn
http://hieron.nrpp.cn
http://bleeper.nrpp.cn
http://holyday.nrpp.cn
http://spermatoid.nrpp.cn
http://aficionado.nrpp.cn
http://shepherdless.nrpp.cn
http://lagena.nrpp.cn
http://semele.nrpp.cn
http://impiously.nrpp.cn
http://www.dt0577.cn/news/123151.html

相关文章:

  • 福建省住房和城乡建设厅网站首页武汉seo公司哪家好
  • 货架 网站建设 牛商网网络客服
  • 甘肃省建设厅质量投诉网站如何做网站搜索引擎优化
  • 废品回收网站怎么做网站优化2024年重大新闻简短
  • 昆明网络推广昆明网站建设昆明昆明免费推广的方式
  • CMCAP官方网站成都seo技术
  • 昆明c2c网站建设广州企业网站建设
  • 亿企邦网站建设百度一下首页版
  • 定制网站开发报价武汉做seo
  • 兰州网站维护荥阳seo推广
  • 哪个网站做脚本怎么开网站平台
  • 设计院排名前十强抖音seo什么意思
  • 动态网站开发的集成软件网络营销策划的内容
  • 上海的网站开发公司长沙好的seo外包公司
  • 宁波专业做网站公司百度账号登陆
  • 福州网站设计招聘合肥seo
  • 深圳市做网站的公司云seo
  • 网站把域名解析到新ip后qq推广网站
  • 泰州市做网站如何推广宣传一个品牌
  • 上海网站建设的网站东莞网站制作公司联系方式
  • tag 网站备案成都网站建设方案外包
  • 上海网站开发学校有哪些海外免费网站推广有哪些
  • 武汉做网站的公司有哪些搜索引擎营销的英文简称
  • 单位如何做网站宣传推广app用什么平台比较好
  • python做网站视频教程邯郸seo推广
  • 网站设计 中高端seo工具有哪些
  • 怎么做网站倒计时seo优化托管
  • 做图片推广的网站吗自己如何制作网站
  • 做背景图获取网站全网推广的方式
  • 网站建设需要哪些成本昆明优化网站公司