前端技术Html,Css,JavaScript,Vue3

Html

1.基本标签

<h1>最大的标题</h1>
<h2> . . . </h2>
<h3> . . . </h3>
<h4> . . . </h4>
<h5> . . . </h5>
<h6>最小的标题</h6><p>这是一个段落。</p>
<br> (换行)
<hr> (水平线)
<!-- 这是注释 -->

2.文本格式化

<b>粗体文本</b>
<code>计算机代码</code>
<em>强调文本</em>
<i>斜体文本</i>
<kbd>键盘输入</kbd> 
<pre>预格式化文本</pre>
<small>更小的文本</small>
<strong>重要的文本</strong><abbr> (缩写)
<address> (联系信息)
<bdo> (文字方向)
<blockquote> (从另一个源引用的部分)
<cite> (工作的名称)
<del> (删除的文本)
<ins> (插入的文本)
<sub> (下标文本)
<sup> (上标文本)

3.链接

普通的链接:<a href="http://www.example.com/">链接文本</a>
图像链接: <a href="http://www.example.com/"><img decoding="async" src="URL" alt="替换文本"></a>
邮件链接: <a href="mailto:webmaster@example.com">发送e-mail</a>
书签:
<a id="tips">提示部分</a>
<a href="#tips">跳到提示部分</a>

4.图片

<img decoding="async" loading="lazy" src="URL" alt="替换文本" height="42" width="42">

5.无序列表

<ul><li>项目</li><li>项目</li>
</ul>

6.有序列表

<ol><li>第一项</li><li>第二项</li>
</ol>

7.表格

<table border="1"><tr><th>表格标题</th><th>表格标题</th></tr><tr><td>表格数据</td><td>表格数据</td></tr>
</table>

8.表单

<form action="demo_form.php" method="post/get">
<input type="text" name="email" size="40" maxlength="50">
<input type="password">
<input type="checkbox" checked="checked">
<input type="radio" checked="checked">
<input type="submit" value="Send">
<input type="reset">
<input type="hidden">
<select>
<option>苹果</option>
<option selected="selected">香蕉</option>
<option>樱桃</option>
</select>
<textarea name="comment" rows="60" cols="20"></textarea></form>

Css

1.选择器

/*id选择器*/
#p {text-align:center;color:black;font-family:arial;
}
/*class选择器*/
.center {text-align:center;}

2.文本和字体

h1 {text-align:center;}
p.date {text-align:right;}h1 {font-size:40px;}

3.链接

a:link {color:#000000;}      /* 未访问链接*/
a:visited {color:#00FF00;}  /* 已访问链接 */
a:hover {color:#FF00FF;}  /* 鼠标移动到链接上 */
a:active {color:#0000FF;}  /* 鼠标点击时 */

4.隐藏

h1.hidden {display:none;}

5.定位position

p.pos_fixed
{position:fixed;   /* 元素的位置相对于浏览器窗口是固定位置 */position:relative; /* 相对定位元素的定位是相对其正常位置 */position:absolute; /*绝对定位的元素的位置相对于最近的已定位父元素,如果元素没有已定位的父元素,那么它的位置相对于<html>*/
}

6.浮动

/*使元素向左或向右移动,其周围的元素也会重新排列*/
img
{float:right;
}

7.对齐

margin: auto;
text-align: center;
/*依据实际情况还可以使用position: absolute,margin,padding,float 实现*/

8.图像

img
{opacity:0.4;  /* 透明度 */
}
img:hover  /* 悬停 */
{opacity:1.0;
}

JavaScript

1.输出

window.alert("") //弹出警告框。
document.write("") //方法将内容写到 HTML 文档中。
document.getElementById("demo").innerHTML = "段落已修改。" //写入到 HTML 元素。
console.log("") //写入到浏览器的控制台

2.函数

function myFunction(a,b){// var定义的变量可以修改,如果不初始化会输出undefined,不会报错var obj = {name:"Fiat", model:500, color:"white"};//const定义的变量不可以修改,而且必须初始化。const s = "s";return a*b;
}

3.常用事件

onchange	//HTML 元素改变
onclick	//用户点击 HTML 元素
onmouseover	//鼠标指针移动到指定的元素上时发生
onmouseout	//用户从一个 HTML 元素上移开鼠标时发生
onkeydown	//用户按下键盘按键
onload	//浏览器已完成页面的加载

4.DOM

var x=document.getElementById("intro");
var y=x.getElementsByTagName("p");
var x=document.getElementsByClassName("intro");

5.改变Html

document.getElementById("p1").innerHTML="新文本!"; // 改变html
document.getElementById(id).attribute="新属性值"; // 改变属性
document.getElementById(id).style.property="新样式" // 改变CSS

6.DOM 元素 (节点)

尾部创建新的 HTML 元素 (节点) - appendChild()
头部创建新的 HTML 元素 (节点) - insertBefore()
移除HTML 元素 - removeChild()
替换 HTML 元素 - replaceChild()

var para = document.createElement("p");
var node = document.createTextNode("这是一个新的段落。");
para.appendChild(node);var element = document.getElementById("div1");
element.appendChild(para);

7.字符串

str.match("world");
str.replace("Microsoft","Runoob");

8.弹框

alert("你好,我是一个警告框!"); // 警告框
var r=confirm("按下按钮");
if (r==true){}else{} // 确认框
var person=prompt("请输入你的名字","Harry Potter");
if (person!=null && person!=""){} // 提示框

Vue

创建Vue工程

模板语法

文本插值,原始 HTML,Attribute 绑定,动态参数

<template><p>{{ msg + '!' }}</p><div v-html="vhtml"></div><div :id="bindId"></div><button :disabled="isButtonDisabled">Button</button><div v-bind="objectOfAttrs"></div><button @click="clk()">按钮</button><hr><a :[attr]="123">动态参数</a>
</template><script setup>
import { ref } from 'vue';const msg = ref("hello world");
const vhtml = '<span style="color: red">This should be red.</span>';
const bindId = "divid";
const isButtonDisabled = true;
const attr = 'href';
const objectOfAttrs = {id: 'divid',class: 'wrapper'
}
function clk(){msg.value='clik !';
}
</script>
<style>
#divid{background: blue;width: 100px;height: 100px;
}
.wrapper{margin: 50px;
}
</style>

响应式基础

<template><p>{{ reactiveMsg.msg + '!' }}</p><p>{{ refMsg }}</p><button @click="clk()">按钮</button>
</template><script setup>
import { reactive, ref } from 'vue';// ref用于普通类型,使用需要.value;reactive用于复杂类型(对象类型),使用不需要.value
// 建议优先使用ref,reactive某些情况会失去响应,参考https://blog.csdn.net/m0_57033755/article/details/129043116
const reactiveMsg = reactive({'msg':'hello world'});
const refMsg = ref('123');
function clk(){reactiveMsg.msg='clik !';refMsg.value = 'clik!';
}
</script>

计算属性

<template><p>{{ msg }}</p><p>{{ reverseMsg }}</p>
</template><script setup>
// 计算属性,相比于method有缓存
const msg = 'hello world';
const reverseMsg = computed(()=>{return msg.split('').reverse().join('');
})
</script>

侦听器

<template><p>{{ msg }}</p><input type="text" v-model="msg"><p>{{ obj.age }}</p><button @click="obj.age = 11">改变msg</button>
</template><script setup>
import { ref, watch, reactive } from "vue";const msg = ref('hello world');
const obj = reactive({ count: 0,age: 1,name:'qwe' })
// watch监听器,当某一个值改变时进入
watch(msg, (newValue, oldValue) => {console.log(oldValue);console.log(newValue);
})
// 加上immediate代表初始化也会进入
watch(msg, (newValue, oldValue) => {console.log(oldValue);console.log(newValue);
},  { immediate: true })
// 监听对象时,自动为深度监听,监听每一个属性变化,影响性能
watch(obj, (newValue, oldValue)=>{console.log(newValue);
})
// 监听对象某一个属性
watch(() => obj.age, (newValue, oldValue) => {console.log(newValue);
})
</script>

Class 与 Style 绑定

<template><p :class="{font : true}">hello</p><!-- 推荐使用驼峰命名 --><p :style="{color : 'red', fontSize : '50px'}">hello!!!</p>
</template><script setup>
</script><style>
.font{font-size: large;color: blue;
}
</style>

条件渲染

<template><p v-if="type == 'A'">A</p><p v-else-if="type == 'B'">B</p><p v-else >C</p><input type="text" v-model="type"><!-- 因为v-if是一个指令,他必须依附于某个元素。如果我们想要切换不止一个元素 <template> 元素上使用 v-if,这只是一个不可见的包装器元素,最后渲染的结果并不会包含这个 <template> 元素 --><template v-if="true"><p>111</p><p>111</p><p>111</p></template><p v-show="true">hello!!!</p>
</template><script setup>
import { ref } from "vue";const type = ref('A')
</script>

列表渲染

<template><ul><li v-for="person in persons" :key="person">{{ person }}</li></ul><button @click="addItem()">增加元素</button><ul><li v-for="(person,index) in persons" :key="index">{{ person }} -> {{ index }}</li></ul><ul><li v-for="obj in objs" :key="obj.name">{{ obj.name }} : {{ obj.age }}</li></ul>
</template><script setup>
import { reactive } from "vue";const persons = reactive(['aaa','bbb','ccc']);
const objs = [{'name':'qqq','age':1},{'name':'www','age':2}]
function addItem(){// 数组变化// push() 末尾添加// pop() 末尾删除// shift() 首位删除// unshift() 首位添加// splice() 删除,插入,替换// sort() 排序// reverse() 反转persons.push('ddd');
}
</script>

事件处理

<template>
{{ count }}  
<button @click="count++">add 1</button>
<button @click="addNum(10)">add 10</button>
<!-- 只传递event对象时,方法不要加上() -->
<button @click="eventClik">event</button>
<button @click="eventClik2(5, $event)">event2</button>
<!--多事件处理-->
<button @click="addNum(1), addNum(2)">多事件处理+3</button>
</template><script setup>
import { ref } from "vue";const count = ref(0);
function addNum(num){count.value += num;
}
function eventClik(event){alert('hello ' + count.value)console.log(event);
}
function eventClik2(num, event){count.value += num;console.log(event);
}
</script>

事件修饰符

<template><div @click="divClick"><!-- stop:阻止事件冒泡 --><button @click.stop="btnClick">按钮</button></div><div><form action=""><!-- prevent:阻止默认行为 --><input type="submit" value="提交" @click.prevent="submitClick"></form><!-- once:只触发一次 --><button @click.once="btnClick">点击一次</button><div><!-- keyup.enter:键盘事件,enter回弹时触发 --><input type="text" @keyup.enter="keyUp"></div></div>
</template><script setup>
function divClick(){alert('父元素');
}
function btnClick(){alert('子元素')
}
function submitClick(){alert('提交成功');
}
function keyUp(){alert('回车确定');
}
</script>

表单输入绑定

<template><p>文本:{{ textMessage }}</p><input type="text" v-model="textMessage"><div><!-- 单个复选框,v-model绑定boolean,代表是否勾选 --><input type="checkbox" v-model="checked">{{ checked }}</div><div><p>选取角色:{{ users }}</p><!-- 多个复选框,需要设置value,v-model绑定value --><input type="checkbox" id="tom" value="Tom" v-model="users"><!-- label可以用来配合input的id,和直接使用字符串没区别 --><label for="tom">Tom</label><input type="checkbox" id="rose" value="Rose" v-model="users">Rose<input type="checkbox" id="jerry" value="Jerry" v-model="users">Jerry</div><div><p>pick: {{ picked }}</p><!-- 单选按钮,需要设置value否则返回on,v-model绑定value,可以省略name --><input type="radio" id="one" value="One" v-model="picked">One<input type="radio" id="two" value="Two" v-model="picked">Two</div><div><p>选择:{{ english }}</p><!-- 选择器单选,value可以省略 --><select v-model="english"><option>A</option><option>B</option><option>C</option></select></div><div><p>选择水果:{{ fruits }}</p><!-- 选择器多选,value可以省略 --><select v-model="fruits" multiple><option>苹果</option><option>香蕉</option><option>橘子</option></select></div>
</template><script setup>
import { ref } from "vue";const textMessage = ref('文本');
const checked = ref(false);
const picked = ref('');
const english = ref('A');
const users = ref([]);
const fruits = ref([]);
</script>

v-model修饰符

.lazy 懒加载,失去焦点再更新
.number 输出变为数字类型
.trim 去除两端空格

父子组件相互传值

父组件:

<template><!-- 使用组件,传递参数;此处:msg父传子;@parentValue子传父 --><hello :msg="msg" @parentValue="getValue"></hello>
</template><script setup>
// 引入组件
import hello from './components/hello.vue';
const msg = 'app.vue';
// 子组件自定义事件对应方法
function getValue(value){alert(value);
}
</script>

子组件:

<template><div>hello</div>{{ msg }}<div><button @click="sendMsgToParent">监听事件传递子组件参数到父组件</button></div>
</template>
<script setup>
// 使用父组件传递的参数
defineProps(['msg']);
// 使用自定义组件实现子传父
const emit = defineEmits(['parentValue']);
function sendMsgToParent(){emit('parentValue', 'from son');
}
</script>

父子组件相互获取值

父组件:

<template><!-- ref可以用来获取该页面dom元素和子组件数据 --><hello ref="helloComponent"></hello><div ref="div"><span></span></div>
</template><script setup>
import hello from './components/hello2.vue';
import { onMounted, provide, readonly, ref } from 'vue';
// ref获取dom元素需要先定义
let helloComponent = ref(null);
const div = ref('');
onMounted(() => {console.log(helloComponent.value.msg);console.log(div.value);
})
// 子获取父数据需要用到provide/inject,setup语法糖只支持一次provide一个变量,readonly只读
provide('div', readonly(div));
</script>

子组件:

<template>{{ msg }}
</template>
<script setup>
import { inject, onMounted, ref } from 'vue';let msg = '子组件';
// 获取父组件provide的值
const div = inject('div');
// setup语法糖写法下组件是默认私有的,defineExpose就是setup语法糖写法中将特定属性、方法显式暴露的宏指令。
// 只有在子组件通过defineExpose显式暴露的属性、方法才能被父组件通过ref获取并使用。
// 需要注意defineExpose必须写在声明好的属性、方法之下,否则会报错!
defineExpose({msg
});
onMounted(() => {console.log(div.value);
})
</script>

插槽

父组件:

<template><hello><!-- 不取名字直接使用 --><span>123123</span><!-- 取名字的插槽需要template包裹 --><template v-slot:msg><h4>来自父组件的信息</h4></template><template v-slot:btn><button>按钮</button></template></hello>
</template><script setup>
import hello from './components/hello3.vue';
</script>

子组件:

<template><div><!-- 插槽相当于占位符 --><slot></slot><slot name="msg"></slot><slot name="btn"></slot></div>
</template>

路由

安装vue路由:

npm install vue-router@4

视图组件包含:
views/Home.vue
views/Error.vue
views/About.vue:

<template><h1>About</h1>
</template>
<script setup>
import { onMounted } from "vue";
import {useRoute} from 'vue-router'onMounted(() =>{alert(useRoute().params.id)
})
</script>

router/index.js:

import {createRouter, createWebHashHistory} from 'vue-router'
// 导入路由组件
import Home from '../views/Home.vue' 
import About from '../views/About.vue'
// 404页面
import Error from '../views/Error.vue'
// 路由映射
const routes = [{path: '/',redirect: '/home'},{path: '/home',component: Home},// :id传参, 传参还可以使用props,接收端需要使用defineProps{path: '/about/:id', component: About},// 匹配所有路径{path: '/:path(.*)', component: Error}
]const router = createRouter({history: createWebHashHistory(),routes
})
// 导出,其他组件才能引入
export default router

main.js:

import router from './router'import { createApp } from 'vue'
import App from './App.vue'const app = createApp(App)
// router必须放在app前面
app.use(router)
app.mount('#app')

App.vue:

<template><div><h1>Hello App!</h1><!-- 底层为a标签 --><router-link to="/">Go to Home</router-link><div></div><router-link to="/about/123">Go to About</router-link><!-- 视图渲染在这里 --><router-view></router-view></div>
</template>

嵌套路由

views/Parent.vue:

<template><h1>Parent</h1><router-link to="/parent/children1">Go to Children1</router-link><div></div><router-link to="/parent/children2">Go to Children2</router-link><router-view></router-view>
</template>

index.js:

import { createRouter, createWebHashHistory } from 'vue-router'
// 导入路由组件
import Parent from '../views/Parent.vue'
import Children1 from '../views/Children1.vue'
import Children2 from '../views/Children2.vue'
// 路由映射
const routes = [{path: '/parent',component: Parent,children: [{path: 'children1',component: Children1},{path: 'children2',component: Children2}]}
]const router = createRouter({history: createWebHashHistory(),routes
})
// 导出,其他组件才能引入
export default router

使用js实现路由

<template><h1>Page</h1><button @click="pageClk">跳转按钮</button>
</template>
<script setup>   
import {useRouter} from 'vue-router'// useRouter一定要放在setup方法内的顶层,否则作用域改变useRouter()执行返回的是undefined
const router = useRouter();
function pageClk(){// js方法实现路由跳转router.push('/parent');
}
</script>

命名视图

同时 (同级) 展示多个视图
views/Top.vue
views/Main.vue
views/Foot.vue

index.js:

import { createRouter, createWebHashHistory } from 'vue-router'
// 导入路由组件
import top from '../views/Top.vue'
import main from '../views/Main.vue'
import foot from '../views/Foot.vue'
// 路由映射
const routes = [{path: '/name',components: {default: main,top,foot}}
]const router = createRouter({history: createWebHashHistory(),routes
})
// 导出,其他组件才能引入
export default router

App.vue:

<template><div><h1>Hello App!</h1><router-link to="/name">Go to 命名视图</router-link><router-view name="top"></router-view><router-view></router-view><router-view name="foot"></router-view></div>
</template>

路由守卫

index.js:
常用来做路由间跳转的判断,规定用户或权限

router.beforeEach((to, from, next) => {if (to.name !== 'Login' && !isAuthenticated) next({ name: 'Login' })else next()
})

Proxy跨域

安装axios:

npm install axios

vite.config.js:

import { defineConfig } from 'vite'
export default defineConfig({server: {proxy: {'/path': {target: 'https://i.maoyan.com', // 替换地址changeOrigin: true, // 开启跨域rewrite: path => path.replace(/^\/path/, '') // 重写路径}}}
})

使用方:

<script setup>
import  axios from 'axios';
// 访问域名 https://i.maoyan.com/api/mmdb/movie/v3/list/hot.json?ct=%E6%88%90%E9%83%BD&ci=59&channelId=4
axios.get('/path/api/mmdb/movie/v3/list/hot.json?ct=%E6%88%90%E9%83%BD&ci=59&channelId=4').then((res) => {console.log(res);
})
</script>

axios和后端通信

<template><div>{{ data }}</div>
</template><script setup>
import axios from 'axios'
import { onMounted, ref } from 'vue';const data = ref('')onMounted(() => {// 考虑跨域axios.get('/local/page-helper/').then(function(res){//.then()表示成功的回调console.log(res.data) data.value = res.data})
})
</script>

Vue3状态管理

存储文件:

import { reactive } from "vue";export const store = reactive({count: 0,increment(){this.count++}
}) 

调用方:

<template><div><span>{{ store.count }}</span></div><button @click="store.increment">按钮</button>
</template><script setup>
import { store } from './store/index';
</script>

Pinia状态管理

安装Pinia:

npm install pinia

main.js:

import {createPinia} from 'pinia'
import { createApp } from 'vue'
import App from './App.vue'const pinia = createPinia()
const app = createApp(App)
app.use(pinia)
app.mount('#app')

store.js:

import {defineStore} from 'pinia'
import {ref, computed} from 'vue'// 按照规范返回值使用use***Store,defineStore第一个参数必须独一无二
export const useAgeStore = defineStore('ageStore', () => {const age = ref(0) // statefunction addAge(){ //actionsage.value ++}const getAge = computed(() => { // getterreturn age.value + 5})return { age, addAge, getAge}
})

使用:

<template><div>{{ ageStore.age }}{{ ageStore.getAge }}</div><button @click="ageStore.addAge">add</button>
</template><script setup>
import {useAgeStore} from './store/ageStore';const ageStore = useAgeStore()
</script>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/32019.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

mac安装nvm管理工具遇到的问题和解决方法

nvm 是一款可以管理多版本node的工具&#xff0c;因为是刚买没多久的电脑之前用的都是windows&#xff0c;昨天折腾了一下午终于倒腾好了 第一步&#xff1a; 卸载电脑已有的node&#xff1b;访问nvm脚本网址&#xff0c;另存为到电脑上任何目录&#xff0c;我是放在桌面上的…

使用eXosip+ffmpeg、ffplay命令行实现sip客户端

文章目录 前言一、关键实现1、主要流程2、解决端口冲突&#xff08;1&#xff09;、出现原因&#xff08;2&#xff09;、解决方法 3、解析sdp&#xff08;1&#xff09;、定义实体&#xff08;2&#xff09;、解析视频&#xff08;3&#xff09;、解析音频 4、命令行推拉流&am…

threejs点击模型实现模型边缘高亮的选中效果--更改后提高帧率

先来个效果图 之前写的那个稍微有点问题&#xff0c;帧率只有30&#xff0c;参照官方代码修改后&#xff0c;帧率可以达到50了&#xff0c;在不全屏的状态下&#xff0c;帧率60 1.首先需要导入库 // 用于模型边缘高亮 import { EffectComposer } from "three/examples/js…

github 无语的问题,Host does not existfatal: Could not read from remote repository.

Unable to open connection: Host does not existfatal: Could not read from remote repository. image.png image.png image.png Please make sure you have the correct access rights and the repository exists. 如果github desktop和git pull 和git clone全部都出问题了&…

[保研/考研机试] KY102 计算表达式 上海交通大学复试上机题 C++实现

描述 对于一个不存在括号的表达式进行计算 输入描述&#xff1a; 存在多组数据&#xff0c;每组数据一行&#xff0c;表达式不存在空格 输出描述&#xff1a; 输出结果 示例1 输入&#xff1a; 6/233*4输出&#xff1a; 18思路&#xff1a; ①设立运算符和运算数两个…

视觉学习(七)---Flask 框架下接口调用及python requests 实现json字符串传输

在项目实施过程中需要与其他系统进行接口联调&#xff0c;将图像检测的结果传递给其他系统接口&#xff0c;进行逻辑调用。这中间的过程可以通过requests库进行实现。 1.安装requests库 pip install requests2.postman 接口测试 我们先通过postman 了解下接口调用&#xff0…

在vue3+vite项目中使用jsx语法

如果我掏出下图&#xff0c;阁下除了私信我加入学习群&#xff0c;还能如何应对&#xff1f; 正文开始 前言一、下载资源二、利用vite工具引入babel插件总结 前言 最近在为部署人员开发辅助部署的工具&#xff0c;技术栈是vue3viteelectron&#xff0c;在使用jsx语法时&#x…

08-2_Qt 5.9 C++开发指南_坐标系统和坐标变换

文章目录 1. 坐标变换函数2. 视口和窗口 1. 坐标变换函数 QPainter 在窗口上绘图的默认坐标系统如下图所示&#xff0c;这是绘图设备的物理坐标。 为了绘图的方便&#xff0c;QPainter 提供了一些坐标变换的功能&#xff0c;通过平移、旋转等坐标变换&#xff0c;得到一个逻辑…

linux Ubuntu 更新镜像源、安装sudo、nvtop、tmux

1.更换镜像源 vi ~/.pip/pip.conf在打开的文件中输入: pip.conf [global] index-url https://pypi.tuna.tsinghua.edu.cn/simple按下:wq保存并退出。 2.安装nvtop 如果输入指令apt install nvtop报错&#xff1a; E: Unable to locate package nvtop 需要更新一下apt&a…

gitlab 503 错误的解决方案

首先使用 sudo gitlab-ctl status 命令查看哪些服务没用启动 sudo gitlab-ctl status 再用 gitlab-rake gitlab:check 命令检查 gitlab。根据发生的错误一步一步纠正。 gitlab-rake gitlab:check 查看日志 tail /var/log/gitlab/gitaly/current删除gitaly.pid rm /var/opt…

SpringBoot 的自动装配特性

1. Spring Boot 的自动装配特性 Spring Boot 的自动装配&#xff08;Auto-Configuration&#xff09;是一种特性&#xff0c;它允许您在应用程序中使用默认配置来自动配置 Spring Framework 的各种功能和组件&#xff0c;从而减少了繁琐的配置工作。通过自动装配&#xff0c;您…

React Native数据存储

最近做RN开发中需要数据存储&#xff0c;查阅RN官方资料&#xff0c;发现推荐我们使用 AsyncStorage,对使用步骤做一下记录。 AsyncStorage是什么 简单的&#xff0c;异步的&#xff0c;持久化的key-value存储系统AsyncStorage在IOS下存储分为两种情况&#xff1a; 存储内容较…

MongoDB【无敌详细,建议收藏】

"探索MongoDB的无边之境&#xff1a;沉浸式数据库之旅" 欢迎来到MongoDB的精彩世界&#xff01;在这个博客中&#xff0c;我们将带您进入一个充满创新和无限潜力的数据库领域。无论您是开发者、数据工程师还是技术爱好者&#xff0c;MongoDB都将为您带来一场令人心动…

【java实习评审】对推电影详情模块的基本电影模型设计到位,并能考虑到特色业务的设计

大家好&#xff0c;本篇文章分享一下【校招VIP】免费商业项目"推电影"第一期 电影详情模块 Java同学的开发文档周最佳作品。该同学来自暨南大学电子信息专业。 本项目的商业出发点&#xff1a; 豆瓣评分越来越水&#xff0c;不太符合年青人的需求&#xff0c;我们推…

【雕爷学编程】Arduino动手做(12)---霍尔磁场传感器模块2

37款传感器与模块的提法&#xff0c;在网络上广泛流传&#xff0c;其实Arduino能够兼容的传感器模块肯定是不止37种的。鉴于本人手头积累了一些传感器和执行器模块&#xff0c;依照实践出真知&#xff08;一定要动手做&#xff09;的理念&#xff0c;以学习和交流为目的&#x…

【Hystrix技术指南】(5)Command创建和执行实现

创建流程 构建HystrixCommand或者HystrixObservableCommand对象 *使用Hystrix的第一步是创建一个HystrixCommand或者HystrixObservableCommand对象来表示你需要发给依赖服务的请求。 若只期望依赖服务每次返回单一的回应&#xff0c;按如下方式构造一个HystrixCommand即可&a…

在R中将列表(list)转换为向量(vector)

问题&#xff1a;将列表中的所有元素“展平”&#xff0c;赋值给一个向量 解决方案&#xff1a;使用unlist()函数&#xff1b; 在许多情况下需要向量&#xff0c;例如&#xff0c;baseR中的许多统计函数需要一个向量作为输入&#xff0c;例如&#xff0c;如果iq.score是一个包…

淘宝商品价格查询接口 批量获取商品详情页数据 支持高并发(含调用实例)

接口开发背景 淘宝商品价格查询可以帮助消费者了解和比较不同商品的价格&#xff0c;从而能够作出更明智的购买决策。通过价格查询&#xff0c;消费者可以找到最具性价比的商品&#xff0c;避免被高价或低价的商品误导。此外&#xff0c;价格查询还可以帮助消费者了解市场行情…

JS dom元素和鼠标位置之间的一系列属性快速参考

clientHeight 获取对象的高度&#xff0c;不计算任何边距、边框、滚动条&#xff0c;但包括该对象的补白。 clientLeft 获取 offsetLeft 属性和客户区域的实际左边之间的距离。 clientTop 获取 offsetTop 属性和客户区域的实际顶端之间的距离。 clie…

Sql奇技淫巧之EXIST实现分层过滤

在这样一个场景&#xff0c;我 left join 了很多张表&#xff0c;用这些表的不同列来过滤&#xff0c;看起来非常合理 但是出现的问题是 left join 其中一张或多张表出现了笛卡尔积&#xff0c;且无法消除 FUNCTION fun_get_xxx_helper(v_param_1 VARCHAR2,v_param_2 VARCHAR2…