我正在尝试@apply在<style>Nuxt.js Vue 文件的标签中使用 Tailwindcss指令。一切正常,但我不断收到一些烦人的红色波浪线。拜托了,伙计们,我需要帮助...谢谢!
下面是一个截图和一个片段:
<style scoped>
.title {
@apply text-orient font-light block text-5xl pt-2;
}
.message {
@apply font-light pb-4 text-orient text-2xl text-blue-bayoux
}
</style>Run Code Online (Sandbox Code Playgroud)
我是 Vue.js 技术的新手。我在运行 Vue 应用程序时遇到错误。不知道我错在哪里,请尝试修复我的错误。
这是我收到错误的临时文件。
Temp.vue
<template>
<div>
<h1>Hello Ashish</h1>
<h2>{{name}}</h2>
</div>
</template>
<script>
export default {
name: "Temp",
};
</script>
Run Code Online (Sandbox Code Playgroud)
应用程序.vue
<template>
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
<!-- <HomeComp msg="Hello Harshal"/> -->
<!-- <ForLoop/> -->
<Temp/>
</template>
<script>
import HelloWorld from './components/HelloWorld.vue'
// import HomeComp from './components/HomeComp.vue';
// import ForLoop from './components/ForLoop.vue';
import Temp from './components/Temp.vue';
export default {
name: 'App',
components: {
HelloWorld,
// HomeComp,
// ForLoop
// Demo,
Temp
}
} …Run Code Online (Sandbox Code Playgroud) 我在 VS Code 中使用 Prettier。我注意到在保存时使用格式时,Prettier 每次都会在对象的最后一行添加尾随逗号。
例如,假设我有一个这样的 JS 对象:
obj = {
hello: 'hello',
world: 'world'
}
Run Code Online (Sandbox Code Playgroud)
Prettier 把它变成了这样:
obj = {
hello: 'hello',
world: 'world',
}
Run Code Online (Sandbox Code Playgroud)
注意后面的额外逗号
'world'
在设置中没有找到解决此问题的选项。
我正在尝试使用 Express NodeJS 中的以下代码向 openai API 发出请求:
import { Configuration, OpenAIApi } from "openai";
const configuration = new Configuration({
organization: "org-Fn2EqsTpiUCTKb8m61wr6H8m",
apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
});
const openai = new OpenAIApi(configuration);
async function callApi() {
const response = await openai.createCompletion({
model: "text-davinci-003",
prompt: "Say this is a test",
max_tokens: 3000,
temperature: 0,
});
console.log(response.data.choices[0].text);
}
callApi();
Run Code Online (Sandbox Code Playgroud)
问题是我不断收到错误 429 Too much requests。
这里有更多信息:
我正在尝试创建一个人们可以付款的付款表格,但我不断收到此错误。
文档未定义
我正在使用 Next.js。请看我下面的代码:
import React from "react";
import {Elements, StripeProvider} from 'react-stripe-elements';
import CheckoutForm from '../../components/Payment/CheckoutForm';
import { useRouter } from 'next/router';
var stripe_load = () => {
var aScript = document.createElement('script');
aScript.type = 'text/javascript';
aScript.src = " https://js.stripe.com/v3/";
document.head.appendChild(aScript);
aScript.onload = () => {
};
};
function Payment({host}) {
const key = host.includes('localhost') ? 'test' : 't';
stripe_load();
const router = useRouter();
return (
<div className="Payment Main">
<StripeProvider apiKey={key}>
<Elements>
<CheckoutForm planid={router.query.id}/>
</Elements>
</StripeProvider>
<br/>
<br/>
<p>Powered by …Run Code Online (Sandbox Code Playgroud) 正在使用的软件包:
"@react-native-community/datetimepicker": "^2.6.0",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-firebase/app": "^8.2.0",
"@react-native-firebase/auth": "^8.2.0",
"@react-navigation/drawer": "^5.8.5",
"@react-navigation/native": "^5.7.0",
"@react-navigation/stack": "^5.7.0",
"date-fns": "^2.14.0",
"react": "16.13.1",
"react-native": "0.63.0",
"react-native-gesture-handler": "^1.6.1",
"react-native-razorpay": "^2.1.35",
"react-native-reanimated": "^1.9.0",
"react-native-safe-area-context": "^3.1.1",
"react-native-screens": "^2.9.0",
"react-native-vector-icons": "^7.0.0"
Run Code Online (Sandbox Code Playgroud)
而 myActivityIndicator被放置在一个屏幕组件中,如下所示:
import React from 'react'
import { View, Text, ActivityIndicator, StyleSheet, Image } from 'react-native'
export default function Loading({navigation}) {
return (
<View style={styles.container}>
<Image
style={styles.main_logo}
source={require('../assets/logo.png')}
/>
<Text style={styles.loading_text}>...Loading...</Text>
<ActivityIndicator animating={true} size="large" style={{opacity:1}} />
</View>
)
}
const styles = StyleSheet.create({
container: { …Run Code Online (Sandbox Code Playgroud) 在我的 ReactJS 应用程序中使用 SwiperJS。我已导入默认样式包,但无法弄清楚如何设置分页容器或项目符号的样式。
在pagination:参数中...每次我更改el: 参数时,分页就会消失。每次我更改bulletClass:样式时,我在 css 中添加的样式都不会被应用。
import { Swiper, SwiperSlide } from 'swiper/react';
import SwiperCore, { Pagination, Navigation, A11y } from 'swiper';
import 'swiper/swiper-bundle.css';
SwiperCore.use([Navigation, Pagination, A11y]);
return (
<>
<Swiper
spaceBetween={50}
slidesPerView={1}
navigation
pagination={{
clickable: true,
el: `swiper-container swiper-container-testClass`,
bulletClass: `swiper-pagination-bullet swiper-pagination-testClass`
}}
wrapperTag='ul'
>
<SwiperSlide tag='li' key={1}>
{<div>My Data</div>}
</SwiperSlide>
</Swiper>
</>
)
Run Code Online (Sandbox Code Playgroud)
有人知道如何覆盖默认样式吗?也就是说,我希望将分页容器移动到幻灯片内容上方,而不是底部幻灯片内部(甚至看不到它)。
有问题的 API:Swiper React
graph LR
A-->B-->C-->D-->E-->F;
Run Code Online (Sandbox Code Playgroud)
graph TD
A-->B-->C-->D-->E-->F;
Run Code Online (Sandbox Code Playgroud)
我喜欢用美人鱼画简单的图表。但流程图似乎只能是top-to-bottomor left-to-right。我可以对方向进行更微妙的控制,使流程图看起来更紧凑(如下图)吗?
试图创建一个 svg 背景图案,但是:
当我不使用填充时可以,当使用颜色名称时:color: red;可以,但是如果使用十六进制颜色,则不会显示任何内容。
这里是代码:
好的:
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='10' ><path fill='red' d='M 0,10 H 20 L 10,0 Z' /></svg>") repeat-x;
Run Code Online (Sandbox Code Playgroud)
不好:
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='10' ><path fill='#FF0000' d='M 0,10 H 20 L 10,0 Z' /></svg>") repeat-x;
Run Code Online (Sandbox Code Playgroud)
还可以查看 jsfiddle:
我正在尝试根据页面加载后的页面,将"活动"类(即class ="active")添加到相应的菜单列表项.下面是我现在的菜单.我已经尝试了在这方面可以找到的每一段代码,但没有任何作用.那么,有人可以简单地解释在javascript中添加定义此任务的位置和方式吗?
<ul id="nav">
<li id="navhome"><a href="home.aspx">Home</a></li>
<li id="navmanage"><a href="manageIS.aspx">Manage</a></li>
<li id="navdocso"><a href="docs.aspx">Documents</a></li>
<li id="navadmin"><a href="admin.aspx">Admin Panel</a></li>
<li id="navpast"><a href="past.aspx">View Past</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud)
这是我在我的网站主文件中放入头标记的javascript示例.我究竟做错了什么?
$(document).ready(function () {
$(function () {
$('li a').click(function (e) {
e.preventDefault();
$('a').removeClass('active');
$(this).addClass('active');
});
});
});
Run Code Online (Sandbox Code Playgroud) javascript ×4
css ×2
node.js ×2
reactjs ×2
vue.js ×2
android ×1
background ×1
eslint ×1
express ×1
flowchart ×1
html ×1
menu ×1
mermaid ×1
next.js ×1
nuxt.js ×1
openai-api ×1
prettier ×1
react-native ×1
svg ×1
swiper.js ×1
tailwind-css ×1