完整的条目是:
/\b(admin|bot)\b/gmi.test(elems.name.value)
如何修改以[а-яА-ЯёЁ]在匹配项中查找?
任务:在字符串中搜索匹配的俄语单词,使用:
/\b(Админ|Бот)\b/gmi
完整的条目是:
/\b(admin|bot)\b/gmi.test(elems.name.value)
如何修改以[а-яА-ЯёЁ]在匹配项中查找?
任务:在字符串中搜索匹配的俄语单词,使用:
/\b(Админ|Бот)\b/gmi
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
plugins: [new HtmlWebpackPlugin({
title: 'OlympTest',
favicon: '',
template: 'src/index.html'
})],
devServer: {
contentBase: './dist'
},
module: {
rules: [
{
test: /\.sss$/,
use: [
'style-loader',
'postcss-loader'
]
},
{
test: /\.(png|jpg|jpeg|svg|gif)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[path][name].[ext]'
}
}
]
}
]
}
};
在 html 我这样添加
如何通过具有特定类名的元素::before正确地将属性添加到块子元素?:last-child
此处的代码示例:
<div class="cv-viewer">
<div class="v-panel v-has-height"></div>
<div class="v-panel v-has-height"></div>
<div class="v-panel hidden"></div>
<div class="v-panel hidden"></div>
</div>
.cv-viewer {
.v-panel {
width: 300px;
height: 200px;
background-color: #000;
margin-bottom: 4px;
position: relative;
}
.hidden{
display: none;
}
& > .v-panel.v-has-height {
&::before {
content: '';
position: absolute;
left: 49px;
top: -32px;
width: 2px;
height: 100%;
background-color: #AD8CED;
z-index: 0;
}
}
& > .v-panel.v-has-height :last-child {
&::before {
content: '';
position: absolute;
left: 49px;
top: -32px;
width: 2px;
height: 58px;
background-color: #AD8CED;
z-index: 0;
}
}
}
由于标记是动态的,子元素的数量会发生变化,因此具有伪元素类的最后一个元素v-has-height必须具有::before有限的高度。