我正在尝试学习 svelte 并构建一个通过 svelte-router-spa 进行路由的卡解决方案。在每个视图(索引和产品详细信息)上,我导入我的变量篮子。这应该包含我在不同页面上的卡片阵列。不幸的是,在每一页上我的数组又是空的。如何在每个页面定义一个全局变量?
感谢您的帮助。
我正在使用光滑的旋转木马类作为滑块.HTML:
<div class="map">
<div>
<div class="step">
<div class="m_left"><a href="#" class="next-slide">?nextPage</a></p>
</div>
<div class="m_right"><img src="/bindella/images/map_tsc.jpg"></div>
</div>
</div>
<div>your content</div>
<div>your content</div>
<div>your content</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
JS:
$(document).ready(function() {
$('.map').slick({
centerMode: true,
adaptiveHeight: true
});
$('.next-slide').click(function() {
$('.map').slickGoTo(1);
});
});
Run Code Online (Sandbox Code Playgroud)
该功能slickGoTo不起作用.怎么了?
我安装了yarn/webpack,然后npm崩溃了!我收到以下错误:
npm -v
node:internal/modules/cjs/loader:928
throw err;
^
Error: Cannot find module '../lib/cli.js'
Require stack:
- /usr/local/lib/node_modules/npm/bin/npm-cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
at Function.Module._load (node:internal/modules/cjs/loader:769:27)
at Module.require (node:internal/modules/cjs/loader:997:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:2:1)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/usr/local/lib/node_modules/npm/bin/npm-cli.js' ]
}
Run Code Online (Sandbox Code Playgroud)
无论我喜欢用 npm 做什么,错误都会出现。我正在使用 Mac OSX 10.14.6
节点版本:15.4.0 纱线版本:1.22.10
感谢帮助。
Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
at module.exports (/Users/hhag/Desktop/test_gulp/node_modules/node-sass/lib/binding.js:13:13)
at Object.<anonymous> (/Users/hhag/Desktop/test_gulp/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Module.require (node:internal/modules/cjs/loader:1013:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object.<anonymous> (/Users/hhag/Desktop/test_gulp/node_modules/gulp-sass/index.js:166:21)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
Run Code Online (Sandbox Code Playgroud)
当我开始使用 gulp 时会发生此错误。是否有将 gulp-sass 与 apple m1 一起使用的解决方案?谢谢
我怎样才能改变
<html lang="en">
Run Code Online (Sandbox Code Playgroud)
到
<html lang="de">
Run Code Online (Sandbox Code Playgroud)
使用 svelteKit?我构建静态页面:
export default {
kit: {
adapter: adapter({
// default options are shown
pages: 'build',
assets: 'build',
fallback: '404.html',
precompress: false
}),
prerender: {
// This can be false if you're using a fallback (i.e. SPA mode)
default: true
}
}
};
Run Code Online (Sandbox Code Playgroud)
感谢帮助