摘要: 初始化 Tailwind CSS 安装 Tailwind 以及其它依赖项: pnpm install -D tailwindcss@latest postcss@latest autoprefixer@latest //或者 npm install -D tailwindcss@latest pos 阅读全文
posted @ 2022-11-29 11:30 小呀小恐龙 阅读(1967) 评论(0) 推荐(0)
摘要: 如果使用Vue进行移动端页面的开发,需要对不同机型的宽高进行适配。最常用的方法是使用amfe-flexable和postcss-pxtorem这两个插件来帮助进行适配。 amfe-flexable amfe-flexable是阿里发布的一套可伸缩适配方案。它能根据设备的宽高来设置页面body元素的字 阅读全文
posted @ 2022-11-29 11:14 小呀小恐龙 阅读(5745) 评论(0) 推荐(1)
摘要: 1、useState:让函数式组件拥有状态 用法示例: // 计数器 import { useState } from 'react' const Test = () => { const [count, setCount] = useState(0); return ( <> <h1>点击了{co 阅读全文
posted @ 2022-11-25 14:28 小呀小恐龙 阅读(31) 评论(0) 推荐(0)
摘要: 1. for 循环 var arr = [1,2,3]; for(var i = 0; i < arr.length; i++) { console.log(i +'-'+ arr[i]); } // 0-1 // 1-2 // 2-3 2. forEach 遍历 遍历数组 列出数组的每个元素 fo 阅读全文
posted @ 2022-11-19 13:54 小呀小恐龙 阅读(159) 评论(0) 推荐(0)
摘要: 一、父组件向子组件传值 1.父组件中定义要传的值 import React, { Component } from "react" import "./assets/css/app.css" // 引入组件A import ComentA from "./components/ComentA" cl 阅读全文
posted @ 2022-07-20 15:21 小呀小恐龙 阅读(279) 评论(0) 推荐(0)
摘要: 一 、react 动态操作className 方案一:(改变style) style={activeStoreId item.id ? { background: '#f5f5f5' } : {}} 方案二:(直接操纵className) className={activeStoreId item. 阅读全文
posted @ 2022-07-18 17:50 小呀小恐龙 阅读(1997) 评论(0) 推荐(0)
摘要: 一、eventBus 创建一个JS文件 eventBus.js import Vue from 'vue' const eventBus = new Vue() export default eventBus 使用时 在 要使用的组件中 import 引入 eventBus.js 使用 $emit 阅读全文
posted @ 2022-06-29 14:26 小呀小恐龙 阅读(484) 评论(0) 推荐(0)
摘要: 【css】三栏布局 三栏布局主要是前后两列定宽,中间自适应 1.浮动 + margin 左边元素左浮动,右边元素有浮动,并给两遍元素都设置宽度。 然后给中间元素设置 margin-left和 margin-right,值都等于左右元素的宽度。 <style> .container { backgro 阅读全文
posted @ 2022-06-27 14:54 小呀小恐龙 阅读(46) 评论(0) 推荐(0)