小编Asi*_*taq的帖子

运行 npx tailwindcss init -p 命令时找不到模块“autoprefixer”

我正在使用 Vue 3 并尝试从以下教程中将 tailwindcss 添加到其中。https://tailwindcss.com/docs/guides/vue-3-vite#install-tailwind-via-npm

我已经使用以下命令安装了依赖项,

npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
Run Code Online (Sandbox Code Playgroud)

但是当我尝试使用以下命令创建配置文件时

npx tailwindcss init -p
Run Code Online (Sandbox Code Playgroud)

它给了我以下错误。

npx:在 5.2s 中安装了 83 找不到模块 'autoprefixer' 需要堆栈:

  • /~/.npm/_npx/33283/lib/node_modules/tailwindcss/lib/cli/commands/build.js
  • /~/.npm/_npx/33283/lib/node_modules/tailwindcss/lib/cli/commands/index.js
  • /~/.npm/_npx/33283/lib/node_modules/tailwindcss/lib/cli/main.js
  • /~/.npm/_npx/33283/lib/node_modules/tailwindcss/lib/cli.js

我不知道为什么autoprefixer没有检测,因为我已经安装了它。甚至 package.json 都有。

{
  "name": "wooclime",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "core-js": "^3.6.5",
    "vue": "^3.0.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/compiler-sfc": "^3.0.0",
    "autoprefixer": "^9.8.6",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^7.0.0-0", …
Run Code Online (Sandbox Code Playgroud)

css npm vue.js tailwind-css vuejs3

13
推荐指数
2
解决办法
8069
查看次数

要修改的列不是标识列

我创建了一个包含列的表现S_ROLL NUMBER(3) NOT NULL在我想将此列作为标识列.我用过这个命令

alter table students
modify
(
S_ROLL NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY
);
Run Code Online (Sandbox Code Playgroud)

然后我收到了这个错误.

S_ROLL NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY
*
ERROR at line 4:
ORA-30673: column to be modified is not an identity column
Run Code Online (Sandbox Code Playgroud)

oracle identity-column

9
推荐指数
1
解决办法
9671
查看次数

JavaFX中Event consume的含义是什么?

我试图理解JavaFX中的事件处理,在那里我发现了这一行.

路径可以修改为路径上的事件过滤器和事件处理程序处理事件.此外,如果事件过滤器或事件处理程序在任何时候消耗该事件,则初始路由上的某些节点可能不会接收该事件.

你能解释一下事件消耗的意义吗?

java events javafx

9
推荐指数
1
解决办法
6923
查看次数

kotlin委托如何有用?

我对kotlin代表团感到很困惑.让我来描述这里的常规多态方法,它看起来与kotlin delgation相同.

interface Base {
    fun print()
}
class BaseImpl(val x: Int) : Base {
    override fun print() { print(x) }
}
fun main(args: Array<String>) {
    val b : Base = BaseImpl(10)
    b.print() // prints 10
}
Run Code Online (Sandbox Code Playgroud)

我可以将任何实现的Base接口类传递给b变量来调用指定类的对象的方法.那个kotlin代表团的好处是什么?这是在这里描述的.

interface Base {
    fun print()
}
class BaseImpl(val x: Int) : Base {
    override fun print() { print(x) }
}
class Derived(b: Base) : Base by b // why extra line of code? 
                                   // …
Run Code Online (Sandbox Code Playgroud)

kotlin

7
推荐指数
3
解决办法
634
查看次数

在嵌套对象 Firestore Android 中添加新字段

Firestore 文档中有更新嵌套对象字段的代码,但没有关于如何在嵌套对象中添加新字段的代码或文档?

// Assume the document contains:
// {
//   name: "Frank",
//   favorites: { food: "Pizza", color: "Blue", subject: "recess" }
//   age: 12
// }
//
// To update age and favorite color:
db.collection("users").document("frank")
        .update(
                "age", 13,
                "favorites.color", "Red"
        );
Run Code Online (Sandbox Code Playgroud)

正如您在这里看到的,我们正在更新favorites.colorto Red,但是我们如何codefavorites对象中添加新字段?

假设我想更新上述文档如下:

{
  name: "Frank",
  favorites: { food: "Pizza", color: "Blue", subject: "recess", code:32 }
  age: 12
}
Run Code Online (Sandbox Code Playgroud)

java android firebase google-cloud-firestore

7
推荐指数
1
解决办法
4137
查看次数

onMounted 中的 useFetch 未在直接链接打开 nuxt3 上获取数据

我使用 来useFetch获取组合 api 中的数据,然后调用组件中 hook 中的函数onMounted,这是代码。

useShows.ts(可组合)

export function useShows(){

    var shows = useState<Show[]>('shows')

    const fetchShows = async() => {
        const {data, pending} = await useFetch<Show[]>('http://localhost:3000/shows')
        shows.value = data.value
    }

    return {shows, fetchShows}
}
Run Code Online (Sandbox Code Playgroud)

显示.vue

<script setup lang="ts">

    var { shows, fetchShows } = useShows()

    onMounted(() => {
        console.log("On mounted called")
        fetchShows()
    })
</script>

<template>
    <div>{{shows}}</div>
</template>
Run Code Online (Sandbox Code Playgroud)

当我/shows从主页导航到它时,它工作正常,但是当我直接打开链接时,localhost/shows它不起作用,只给我空值。

vue.js vue-composition-api nuxtjs3

7
推荐指数
1
解决办法
3493
查看次数

使用float给出"调用重载函数是模糊的"错误

我正在重载该函数add(),但是当我使用float数据类型时它显示错误.但是,当我将其更改为时double,它的工作正常.为什么会float导致错误?

代码是:

#include <iostream>
using namespace std;
class students{
    private:
        int i;
        float f;

    public:
        void add(int b){
            i=b;
            cout << "First Int: " << i;
        }
        void add(float c){
            f=c;
            cout << "Second Int: " << f;
        }

};

int main(){
    students obj;
    obj.add(9);
    obj.add(5.5);
}
Run Code Online (Sandbox Code Playgroud)

错误:

In function 'int main()':
[Error] call of overloaded 'add(double)' is ambiguous
[Note] candidates are:
[Note] void students::add(int)
[Note] void students::add(float)
Run Code Online (Sandbox Code Playgroud)

c++ overloading ambiguous

6
推荐指数
1
解决办法
2339
查看次数

为什么在push_back()后Vector的size()和capacity()不同

我刚刚开始学习矢量而且很困惑size(),capacity() 我对它们两者知之甚少.但为什么这个程序都不同?甚至array(10)为10个元素腾出空间并用0初始化.

在添加之前 array.push_back(5)

那么array.size();10就可以了.

那么array.capacity();10就可以了.

添加后 array.push_back(5)

那么array.size();11就可以了(already 10 time 0 is added and then push_back add one more element 5 ).

所以array.capacity();是15,为什么?( is it reserving 5 blocks for one int? ).

#include <iostream>
#include <vector>
int main(){
    std::vector<int> array(10); // make room for 10 elements and initialize with 0
    array.reserve(10);    // make room for 10 elements
    array.push_back(5);
    std::cout << array.size() << …
Run Code Online (Sandbox Code Playgroud)

c++ allocation vector

6
推荐指数
3
解决办法
3865
查看次数

什么"一个过去的最后元素"在向量中意味着什么?

我正在学习向量,并对数组如何在这里复制到向量感到困惑

double p[] = {1, 2, 3, 4, 5};
std::vector<double> a(p, p+5);
Run Code Online (Sandbox Code Playgroud)

我也知道std::vector<double> a(3,5);`为3腾出空间并用5初始化它们.上面的代码如何工作?

第二点是我从我复制上述代码的地方读到的段落.

在使用矢量或任何其他标准容器时,理解第二点至关重要.受控序列始终以[first,one-last-last]表示 - 不仅适用于ctors,还适用于对一系列元素进行操作的每个函数.

我不知道是什么意思[first, one-past-last)?我在数学上知道,但不知道为什么/如何以这种方式复制数组?

编辑

另一个相关问题

成员函数end()返回一个迭代器,该迭代器one-past-the-last-element在序列中"指向" .请注意,取消引用返回的迭代器end()是非法的,并且具有未定义的结果.

你能解释one-past-the-last-element一下它是什么吗?为什么?

c++ vector

6
推荐指数
2
解决办法
2162
查看次数

模块不依赖于Intellij IDEA 2017.2.5 Java 9

我刚刚在命令行中测试了我对java 9模块的理解.然后我转到Intellij IDEA 2017.2.5进行测试.在那里,我面临错误module is not in dependencies不知道为什么intellij显示错误.

我只是在module-info.javaas exportsrequires.中编写必需的语句.

然后我使用Intellij智能来解决IDEA的错误.只需ALT + ENTER然后点击Add dependency on module 'module-name-here'.但我不知道Intellij在幕后做了什么.有什么想法吗?

java intellij-idea java-9

6
推荐指数
1
解决办法
1148
查看次数