vue组件知识小结

news/2024/7/10 1:38:12 标签: vue, 组件

1、注册组件
2、引用组件(import login from './components/login')
3、声明组件(components:{'v-hello': hello} )
4、挂载组件(<v-hello></v-hello>)

以下myself、login、HelloWord、menu等都为另外的vue文件,具体见vue代码

<template>

<div id='add'>
  <el-container style="height: 600px; border: 1px solid #eee">
  <el-aside width="240px">
      <v-menu></v-menu>
  </el-aside>
  <el-container>
    <el-breadcrumb style="text-align: right; font-size: 32px">
      <v-hello></v-hello>
    </el-breadcrumb>
    <el-header style="text-align: right; font-size: 20px">
      <v-myself></v-myself>  
    </el-header>
    <el-main>
      <!-- <v-login></v-login> -->
      <!-- <v-ac></!--> 
      <router-view/>
    </el-main>
    <el-footer>
      <v-foot></v-foot>
    </el-footer>
  </el-container>
</el-container>
</div>   
</template>
<script>
/*
1、注册组件
2、引用组件(import login from './components/login')
3、声明组件(components:{'v-hello': hello} )
4、挂载组件(<v-hello></v-hello>)
*/

import myself from './myself'
import login from './login'
import hello from './HelloWorld'
import menu from './menu'
import foot from './foot'
// import ac from './ac'


export default {
  name: 'Add',
  data(){
     
    return{
      message: ''     
    }
  },
  methods:{
    
 },
 components:{
     'v-myself':myself,
     'v-login':login,
     'v-hello': hello,
     'v-menu':menu,
     'v-foot':foot
    //  'v-ac':ac
     
 }
}

</script>

<style>
  .el-breadcrumb{
    background-color: rgb(169, 181, 197);
    background-image: url('../assets/ni.jpg');
    color: #333;
    font-size: 20px;
    font-family: 'STKaiti';
  
    }
 .el-header, .el-footer {
    background-color: #B3C0D1;
    background-image: url('../assets/ai.jpg');
    color: #333;
    text-align: right;
    line-height: 60px;
  }
  
  .el-aside {
    background-color: #D3DCE6;
    background-image: url('../assets/yi.jpg');
    color: #333;
    text-align: center;
     
  }
  
  .el-main {
    background-color: white;
    color: #333;
    text-align: center;
    line-height: 50px;
  }
  
  body > .el-container {
    margin-bottom: 40px;
  }
  
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>

 


http://www.niftyadmin.cn/n/1205744.html

相关文章

vue页面跳转router的问题,子路径

以下仅供参考&#xff0c;若有不足请提出。 在router的index.js添加path 之前做项目的index.js import Vue from vue import Router from vue-router import login from /components/login import ac from /components/ac import Ulogin from /components/Ulogin import Add …

“玲珑杯”线上赛 Round #15 河南专场 C 咸鱼魔法记

C – 咸鱼魔法记 Time Limit&#xff1a;1s Memory Limit&#xff1a;128MByte Submissions&#xff1a;394Solved&#xff1a;137 DESCRIPTION 给你一个01串&#xff0c;我们定义这个串的咸鱼值&#xff0c;是最长的全1串。现在你最多可以使用K次咸鱼魔法&#xff0c;每次魔…

HTML5与CSS3 对盒使用阴影--box-shadow的使用方法

box-shadow:length length length color; 前面三个length分别指阴影离开文字的横方向距离、阴影离开文字的纵方向距离和阴影的模糊半径 <!DOCTYPE html> <html> <head> <meta charset"utf-8"> <title></title> <style type…

CSS Text

http://www.runoob.com/css/css-text.html 文本颜色 颜色属性被用来设置文字的颜色。 颜色是通过CSS最经常的指定&#xff1a; 十六进制值 - 如: &#xff03;FF0000一个RGB值 - 如: RGB(255,0,0)颜色的名称 - 如: redbody {color:red;} h1 {color:#00ff00;} h2 {color:rgb(255…

vue openlayers学习

1、安装vue-cli3.0.1: Installation | Vue CLI cnpm install -g vue/cli vue -V 查看版本(出现错误【 vue 不是内部或外部命令&#xff0c;也不是可运行的程序 或批处理文件】处理方法 vue-cli 3.X安装【 vue 不是内部或外部命令&#xff0c;也不是可运行的程序 或批处理文…

openlayers入门学习一

openlayers官方文档&#xff1a;http://iclient.supermap.io/web/introduction/openlayersDevelop.html#top 官方文档对我来说有点乱&#xff0c;看不是很懂&#xff0c;而且上面是以HTML写的&#xff0c;我在做的时候用的是vue写的。 项目的创建就不多说了&#xff0c;我用了…

微信小程序之页面路由

路由方式 简介 对于路由的触发方式以及页面生命周期函数如下&#xff1a; 路由方式触发时机路由前页面路由后页面初始化小程序打开的第一个页面 onLoad, onSHow打开新页面调用 API wx.navigateTo 或使用组件 <navigator open-type"navigateTo"/>onHideonLoad, …

Vue如何刷新当前页面

在做登录界面的时候遇到刷新页面的问题&#xff0c;用 this.$router.push(/);不能返回刷新界面&#xff0c;错误的账号密码依然留在上面&#xff0c;在百度之后遇到了好的解决方法&#xff0c;原文链接&#xff1a;https://blog.csdn.net/qq_16772725/article/details/80467492…