我想要制作边框动画并缓慢显示它,就像这个 Codepen一样,但有一些区别:
不删除旧行,但需要显示类似的内容。
颜色不应该是霓虹灯而只是简单的边框
它应该只动画一次而不重复。
<div class="boxes">
<div class="row">
<div
class="col-lg-6"
data-aos="zoom-in-right"
data-aos-duration="800"
>
<div class="right-box left">
<h2>Heading1.</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nulla in erat et quam semper convallis. Phasellus vel nisl
id leo suscipit molestie. Sed nec dignissim urna. Donec
sit amet tortor nulla. Etiam tempus dui id ipsum commodo,
et laoreet tortor luctus. Ut dapibus.
</p>
</div>
</div>
<div
class="col-lg-6"
data-aos="zoom-in-left"
data-aos-duration="800"
>
<div class="left-box">
<img …Run Code Online (Sandbox Code Playgroud) 我正在用 React Native 制作一个测验应用程序,我想在每次有人选择测验时打乱问题的顺序 。我正在考虑使用lodash中的shuffle,但我不完全确定如何处理嵌套数组。
const getTest = async () => {
try {
const response = await fetch('https://tgryl.pl/quiz/test/'.concat(route.params.testId));
const json = await response.json();
setData(json);
}
catch (error) {
console.error(error);
}
}
Run Code Online (Sandbox Code Playgroud)
我在想类似的事情setData(_.shuffle(data.tasks))?我不知道
JSON 看起来像这样
<script>\n import * as Vue from 'vue'\nimport Component from 'vue-class-component'\n\n@Component\nexport default class HelloWorld extends Vue {\n //my operation\n}\n\n</script>\nRun Code Online (Sandbox Code Playgroud)\n这是一个简单的示例vue-class-component。\n但是,当我运行我的项目时,浏览器显示以下错误:
Uncaught TypeError: Class extends value #<Object> is not a constructor or null\nat eval (HelloWorld.vue?e90b:39:1)\nat Module../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/HelloWorld.vue?vue&type=script&lang=js (app.js:19:1)\nat __webpack_require__ (app.js:315:33)\nat fn (app.js:570:21)\nat eval (HelloWorld.vue?vue&type=script&lang=js:5:213)\nat Module../src/components/HelloWorld.vue?vue&type=script&lang=js (app.js:162:1)\nat __webpack_require__ (app.js:315:33)\nat fn (app.js:570:21)\nat eval (HelloWorld.vue:3:97)\nat Module../src/components/HelloWorld.vue (app.js:140:1)\nRun Code Online (Sandbox Code Playgroud)\n为什么会出现这种情况?并且cmd还显示这样的警告:
in ./node_modules/vue-class-component/dist/vue-class-component.esm.js\nexport 'default' (imported as 'Vue') was not found in 'vue' (possible exports: BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的 Blade 视图中使用它。我.vue在 JS 中有文件和以下代码:
import Multiselect from 'vue-multiselect'
export default {
components: {
Multiselect
},
data () {
return {
value: '',
options: ['Select option', 'options', 'selected', 'mulitple', 'label', 'searchable', 'clearOnSelect', 'hideSelected', 'maxHeight', 'allowEmpty', 'showLabels', 'onChange', 'touched']
}
}
}
Run Code Online (Sandbox Code Playgroud)
当我像这样在 Blade 中添加组件时:
<div>
<label class="typo__label">Single select</label>
<multiselect v-model="value" :options="options" :searchable="false" :close-on-select="false" :show-labels="false" placeholder="Pick a value"></multiselect>
<pre class="language-json"><code>@{{value}}</code></pre>
</div>
Run Code Online (Sandbox Code Playgroud)
选择不起作用,它只显示{{value}}字符串。有任何想法吗?
我无法理解这段代码中的问题:
export default function CustomPopup({wi,he,children}) {
//some code
const [popupSize,setPopupSize] = useState([`${wi}px`,`${he}px`])
const handlePopupSize = () =>{
let c = [];
(window.innerWidth < (wi/0.9)) ? c[0] = `90%` : c[0] = `${wi}px`;
(window.innerHeight < (he/0.8)) ? c[1] = `80%` : c[1] = `${he}px`;
if (c != popupSize) { setPopupSize(c) };
}
window.addEventListener("resize", handlePopupSize)
return (
<div className="popup--page--wrapper">
<div className="popup--box" style={{width: popupSize[0], height: popupSize[1]}}>
{ children }
</div>
</div>
)
}
Run Code Online (Sandbox Code Playgroud)
当我调整页面大小时,页面会严重滞后,甚至导致浏览器出现错误。代码似乎有问题,但我无法找出。提前致谢!
我正在创建一个 Vuejs 应用程序,并且想使用 Vuex。
但我无法添加 Vuex 商店。
这是我的代码:
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
userData: "USER!"
},
mutations: {
},
actions: {
},
getters: {
}
})
export default store
Run Code Online (Sandbox Code Playgroud)
我收到错误:
未捕获的语法错误:请求的模块“/node_modules/.vite/vue.js?v=52de2cee”不提供名为“default”的导出
main.js
import { createApp } from 'vue'
import App from './App.vue'
import router from '@/router'
const app = createApp(App)
import Vuex from 'vuex'
import { store } from '@/store/users'
app.use(router)
app.use(Vuex)
app.mount('#app')
Run Code Online (Sandbox Code Playgroud)
我做错了什么?多谢。
我试图在 Javascript 中找到另一个数组中一个数组的索引,如下所示:
const piece = [5, 10];
const array = [[5, 10], [5, 11]];
//Using indexOf
console.log(array.indexOf(piece));
//Using findIndex
console.log(array.findIndex(function(element) {
return element == piece;
}));Run Code Online (Sandbox Code Playgroud)
我期望这些返回 0,因为这是我的“片段”在较大数组内的索引,但这两种方法都返回-1
有什么想法为什么会发生这种情况吗?如果我有其他方法可以做到这一点?
谢谢。