我有一个wordpress主题和一个需要最后加载的样式表,因为插件css干扰了我的主题.我想知道是否有某种类型的函数可以用来使主样式表在我的主题中加载到最后.
我在这里使用select 组件的精确标记
<FormControl
variant="outlined"
className={classes.formControl}
error={errors.title ? true : false}
>
<InputLabel htmlFor="title">Who are you?</InputLabel>
<Select
labelId="titleLabel"
id="title"
value={state.title ? state.title : 'Example1'}
onChange={handleChange}
label="Who are you?"
>
<MenuItem value={`Example1`}>Example1</MenuItem>
<MenuItem value={`Example2`}>Example2</MenuItem>
<MenuItem value={`Example3`}>Example3</MenuItem>
<MenuItem value={`other`}>other</MenuItem>
</Select>
{errors.title && <FormHelperText>{errors.title}</FormHelperText>}
</FormControl>
Run Code Online (Sandbox Code Playgroud)
然后我不断收到以下错误,不知道如何解决这个问题
index.js:1 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Transition which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely …Run Code Online (Sandbox Code Playgroud) 我想创建一个2文本列,中间有一个div,如下所示.

我正在使用此代码:
-moz-column-count: 2;
-webkit-column-count: 2;
column-count: 2;
Run Code Online (Sandbox Code Playgroud)
当我在div类中放置另一个div时,它会格式化为两列.我该如何解决?
我希望css在 JS 中导入的每个文件都为我的构建创建一个新的 css 文件。例如:
import "./app.css";
import "./admin.css";
Run Code Online (Sandbox Code Playgroud)
将创建dist/app.css和dist/admin.css。我正在使用汇总,这是我的配置文件:
import commonjs from "@rollup/plugin-commonjs";
import postcss from "rollup-plugin-postcss";
import resolve from "@rollup/plugin-node-resolve";
import { terser } from "rollup-plugin-terser";
import postcssImport from "postcss-import";
import postcssNested from "postcss-nested";
import autoprefixer from "autoprefixer";
const dev = process.env.WP_ENV === "development";
export default {
input: "src/main.js",
output: {
sourcemap: dev,
format: "iife",
name: "main",
file: "dist/main.bundle.js",
},
plugins: [
resolve({
browser: true,
}),
postcss({
plugins: [postcssImport(), postcssNested(), autoprefixer()],
extract: …Run Code Online (Sandbox Code Playgroud) 我很难理解两者之间的差异.我尝试下载库,没有代码.我正在尝试构建一个基本的滑块以及我在jQuery中构建的其他基本功能.任何帮助,教程,插件和信息都会非常有用!
我在自定义 WordPress 主题中的 woocommerce 模板时遇到一些问题。我想在我的模板中添加额外的数据作为变量。
我想在仪表板/我的帐户页面上显示活动订单。我想通过按顺序将数据变量传递到模板以便能够调用来实现此目的,就像在模板中完成的那样orders.php。
我知道我可以覆盖我的主题中的 ,然后在仪表板或我的帐户的函数wc-template-functions.php中添加数据。wc_get_templates但是,我不想这样做。
我尝试过创建一个钩子,例如:
函数.php
function wc_fr_add_orders_to_account( $fr_account_orders, $current_page ) {
global $fr_account_orders;
$current_page = empty( $current_page ) ? 1 : absint( $current_page );
$customer_orders = wc_get_orders( apply_filters( 'woocommerce_my_account_my_orders_query',
array(
'customer' => get_current_user_id(),
'page' => $current_page,
'paginate' => true,
'status' => array( 'wc-pending' )
) ) );
$fr_account_orders = array(
'current_page' => absint( $current_page ),
'customer_orders' => $customer_orders,
'has_orders' => 0 < $customer_orders->total
);
return $fr_account_orders;
}
add_action( 'woocommerce_account_content', …Run Code Online (Sandbox Code Playgroud) 我已经安装@types/jwt-decode,但无法正常工作。
import jwtDecode from 'jwt-decode'
...
let decodedToken = jwtDecode(token);
console.log(decodedToken) // this works! I can see the full object
console.log(decodedToken.exp) // error Object is of type 'unknown'.ts(2571)
Run Code Online (Sandbox Code Playgroud) 我对测试很陌生,我终于觉得自己掌握了窍门。然而,mocks 仍然有点令人困惑。我目前正在测试一个注册功能,这些功能一直执行到Auth.signUp. 我不确定我是否需要在我的测试中模拟某些东西,或者我是否需要它来运行不同的测试。
async function signUp(
{ first, last, email, password }: SignupUserType,
dispatch: Dispatcher,
formContent: FormContentType,
setFormContent: SetFormContent,
) {
console.log('signing in init...');
dispatch({ type: 'INIT' });
try {
const user = await Auth.signUp({
username: email,
password,
attributes: {
given_name: first,
family_name: last,
picture: userImage,
},
});
console.log('sign up success!');
dispatch({ type: 'STOP_LOADING' });
console.log(formContent);
setFormContent(formContent);
} catch (err) {
console.log('error signing up...', err);
dispatch({ type: 'ERROR', error: err.message, doing: 'SIGNUP' });
}
}
Run Code Online (Sandbox Code Playgroud)
测试
import Amplify, …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 删除提交列表git rebase -i HEAD~19。我过去曾成功地使用过此方法,但是当我尝试运行然后退出vim而不进行任何更改(:q!)时,我收到此错误:
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:
git commit --allow-empty
Otherwise, please use 'git cherry-pick --skip'
interactive rebase in progress; onto dd0b851
Run Code Online (Sandbox Code Playgroud)
我不是在挑选,也不知道为什么我会遇到要跳过的错误。
我目前正在学习 React,并且我有一个使用 webpack、babel 和 React 的应用程序。看来 React 有两种使用 或 来编写它的required方法import。似乎还有更多关于使用的文档import。如何更改我的堆栈以使用导入版本?
css ×3
reactjs ×3
wordpress ×2
aws-amplify ×1
build ×1
cherry-pick ×1
enzyme ×1
function ×1
git ×1
hook ×1
html ×1
javascript ×1
jestjs ×1
jquery ×1
jwt ×1
material-ui ×1
php ×1
phpcs ×1
postcss ×1
rebase ×1
rollupjs ×1
stylesheet ×1
templates ×1
typescript ×1
woocommerce ×1