使用节点 13.1.0 安装依赖项时收到一堆警告和错误。
c++ '-DNODE_GYP_MODULE_NAME=绑定' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE =1''-D_LARGEFILE_SOURCE''-D_FILE_OFFSET_BITS=64'' -DOPENSSL_NO_PINSHARED''-DOPENSSL_THREADS''-DBUILDING_NODE_EXTENSION'-I/Users/marinosony/.node-gyp/13.1.0/include/node -I/Users/marinosony/.node-gyp/13.1.0/src -I/用户/marinosony/.node-gyp/13.1.0/deps/openssl/config -I/Users/marinosony/.node-gyp/13.1.0/deps/openssl/openssl/include -I/Users/marinosony/.node -gyp/13.1.0/deps/uv/include -I/Users/marinosony/.node-gyp/13.1.0/deps/zlib -I/Users/marinosony/.node-gyp/13.1.0/deps/v8 /include -I../../nan -I../src/libsass/include -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused -参数-std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -std=c++11 -MMD -MF ./Release/.deps/Release/obj.target/binding/src/create_string .odraw -c -o Release/obj.target/binding/src/create_string.o ../src/create_string.cpp ../src/create_string.cpp:17:25:错误:没有匹配的构造函数用于初始化'v8 ::String::Utf8Value' v8::String::Utf8Value 字符串(值);^ ~~~~~ /Users/marinosony/.node-gyp/13.1.0/include/node/v8.h:3064:5:注意:候选构造函数不可行:没有从 'v8::Local' 到 'v8::Local' 的已知转换'const v8::String::Utf8Value' 第一个参数 Utf8Value(const Utf8Value&) = delete; ^ /Users/marinosony/.node-gyp/13.1.0/include/node/v8.h:3057:5:注意:候选构造函数不可行:需要 2 个参数,但提供了 1 个 Utf8Value(Isolate*isolate, Local obj );^ 生成 1 个错误。make: *** [Release/obj.target/binding/src/create_string.o] 错误 1 gyp …
我已经使用Ant design的表单组件v-decorators来验证表单,我想显示客户端(我目前已经完成的 v-decorator 规则验证)以及服务器端表单数据验证。
将此视为示例登录表单:
<template>
<AForm
:form="form"
@submit.prevent="handleSubmit"
>
<FormItem>
<AInput
v-decorator="['email', { rules: [{ required: true, message: 'Please input your email!' }] }]"
placeholder="Email"
/>
</FormItem>
<FormItem>
<AInput
v-decorator="['password', { rules: [{ required: true, message: 'Please input your Password!' }] }]"
placeholder="Password"
type="password"
/>
</FormItem>
<FormItem>
<AButton
html-type="submit"
class="w-full"
:loading="loading"
>
Log in
</AButton>
</FormItem>
</AForm>
</template>
<script>
import { Form, Input, Button } from 'ant-design-vue';
import { mapActions } from 'vuex';
export default …Run Code Online (Sandbox Code Playgroud) 我在一个数组中有 3 个对象,其中所有对象都具有相同数量的数据属性。数据如下:
const monthStats = [{
name: 'pending',
data: ['5', '1', '2', '3', '100', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '20', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'],
}, {
name: 'delivered',
data: ['10', '44', '12', '0', '250', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '180', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'],
}, {
name: …Run Code Online (Sandbox Code Playgroud) 我创建了一个基本的 MERN 登录页面,但我对如何在成功登录后重定向用户感到有些困惑。我创建了一个登录上下文,当用户成功登录时,我将登录状态设置为 true。我不确定如何重定向到 /items 路由。任何帮助,将不胜感激。这是我的应用程序代码:
function App() {
return (
<LoggedInProvider>
<ThemeProvider>
<Switch>
<Route
exact
path="/"
render={() => <SignIn />}
/>
<Route
exact
path="/items"
render={() => <Index />}
/>
</Switch>
</ThemeProvider>
</LoggedInProvider>
);
}
export default App;
Run Code Online (Sandbox Code Playgroud)
这是我的登录组件:
function Form(props) {
const { isDarkMode } = useContext(ThemeContext);
const { loggedIn, changeLogIn } = useContext(LoggedInContext);
const [isSignUp, setSignUp] = useState(false);
const { classes } = props;
const [usernameValue, setUsernameValue] = useState('');
const [passwordValue, setPasswordValue] = useState('');
const handleUsernameChange = (e) …Run Code Online (Sandbox Code Playgroud) 我在网页上有一个按钮,进行以下检查:
<button type="button" class="odd-item-dropdown-confirm" data-qa="button-odd-item-dropdown-confirm">Confirm</button>
我想点击这个按钮,我试过:
function clickConfirm(){
var bntConfirm = document.querySelector('.btn.button-odd-item-dropdown-confirm');
bntConfirm.click();
}
clickConfirm();
Run Code Online (Sandbox Code Playgroud)
并得到 Uncaught TypeError: Cannot read property 'click' of null
我对 Vue.js 有疑问。我怎样才能解决这个问题?我在文档中没有找到任何内容。我收到此错误:“[vue/require-v-for-key] 迭代中的元素期望具有 'v-bind:key' 指令。”
这是:“迭代中的元素期望有‘v-bind:key’指令。”
我的 Roulette.vue 有这个
<template>
<div class="roulette">
<h1>Roulette</h1>
<div class="radio" v-for="genre in genres"> **here**
<input
@change="onGenrePick"
type="radio"
name="genre"
v-bind:id="genre.id"
v-bind:value="genre.id">
<label v-bind:for="genre.id">{{genre.name}}</label>
</div>
<Button class="btn" :onClick="roll">Roll</Button>
<MovieCard
v-if="!!movie"
v-bind:image="serviceGetImagePath(movie.poster_path)"
v-bind:title="movie.title"
v-bind:releaseDate="serviceFormatYear(movie.release_date)"
v-bind:id="movie.id"
v-bind:voteAverage="movie.vote_average"/>
</div>
</template>
<script>
import MovieCard from '../components/MovieCard'
import Button from '../components/Button'
import {movieService} from '../mixins/movieService'
export default {
name: 'Roulette',
components: {Button, MovieCard},
mixins: [movieService],
mounted: async function () {
this.genres = await this.serviceGetGenres()
},
data: () => ({
genres: [], …Run Code Online (Sandbox Code Playgroud) javascript ×4
vue.js ×2
antd ×1
arrays ×1
forms ×1
node-modules ×1
node-sass ×1
node.js ×1
npm ×1
object ×1
react-router ×1
reactjs ×1
validation ×1