你好开发人员我一整天都在尝试在我的项目上实现图表,但是按照官方文档,我无法摆脱这个错误:
ERROR in ./node_modules/ng2-charts/__ivy_ngcc__/fesm2015/ng2-charts.js 317:8-21
"export 'pluginService' was not found in 'chart.js'
node_modules/ng2-charts/lib/base-chart.directive.d.ts:4:59 - error TS2305: Module '"../../chart.js/types/index.esm"' has no exported member
'ChartPoint'.
4 import { ChartConfiguration, ChartDataSets, ChartOptions, ChartPoint, ChartType, PluginServiceGlobalRegistration, PluginServiceRegistrationOptions } from 'chart.js';
~~~~~~~~~~
node_modules/ng2-charts/lib/base-chart.directive.d.ts:4:82 - error TS2305: Module '"../../chart.js/types/index.esm"' has no exported member
'PluginServiceGlobalRegistration'.
4 import { ChartConfiguration, ChartDataSets, ChartOptions, ChartPoint, ChartType, PluginServiceGlobalRegistration, PluginServiceRegistrationOptions } from 'chart.js';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/ng2-charts/lib/base-chart.directive.d.ts:4:115 - error TS2305: Module '"../../chart.js/types/index.esm"' has no exported member 'PluginServiceRegistrationOptions'.
4 import { ChartConfiguration, ChartDataSets, ChartOptions, ChartPoint, …Run Code Online (Sandbox Code Playgroud) 我想知道是否可以从计算函数中通过 Vue.js 中的 id 获取元素。这是一个愚蠢的问题,但由于某种原因,当我尝试记录此条件时,它给了我 null 作为响应。
假设这些是 html 标签:
<button id="dice1" class="revol"></button>
<button id="dice2" class="revol"></button>
Run Code Online (Sandbox Code Playgroud)
然后在我的一种计算方法中,我尝试访问两个 ID
computed: {
roll(){
document.getElementById("dice1").className += "dic1";
document.getElementById("dice2").className += "dic2";
...some code
}
}
Run Code Online (Sandbox Code Playgroud)
由于错误,我检查了创建的钩子发生了什么,并意识到document.getElementById任何 id 的返回 null
created() {
console.log(document.getElementById("dice1"));
console.log(document.getElementById("dice1"));
},
Run Code Online (Sandbox Code Playgroud)
另外,我没有直接引用 DOM 元素,而是初始化变量并将 elementsById 分配给它们,但结果是相同的
rollDice() {
var diceFirst= document.getElementById("dice1");
var diceSecond= document.getElementById("dice2")
diceFirst.className += "dic1";
diceSecond.className += "dic2";
....some code
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能改善这种情况?提前致谢!
我在某些应用程序中遇到了一些困难,我正在尝试构建想要从我的 firebase 上传图像/到我的 firebase 的图像...已经尝试查看一些具有相同问题但可能不同代码的可能解决方案但它不起作用。我可以分享我的,以便您可以告诉我出了什么问题吗?这里的行:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp()
const path = require('path');
const os = require('os');
const cors = require('cors')({ origin: true });
const BusBoy = require('busboy')
const fs = require('fs');
const gcConfig = {
projectId: 'meeting-scheduler-9cee1',
keyFilename: "meeting-scheduler-9cee1-firebase-adminsdk-3unr4-09df5fe69a.json"
}
const { Storage } = require("@google-cloud/storage");
exports.upLoadFile = functions.https.onRequest((request, response) => {
cors(request, response,() => {
const busBoy = new BusBoy({ headers: request.headers});
let uploadData = null;
if (request.method !== "POST") {
return response.status(500).json({ …Run Code Online (Sandbox Code Playgroud) 开发人员大家好,我在这个 Angular+MySQL+Spring-Boot 应用程序中工作,我正处于将数据库导出到 AWS 的阶段,但出于某种原因,在测试了与 mySQL Workbench 的数据库连接后,当我设置application.properties中的参数出现错误 java.sql.SQLException: No database selected。
AWS 抛出的端点以及端口是:
endpoint: bookingrestaurantok.clnhc7kmwszz.us-west-2.rds.amazonaws.com
port: 3306
Run Code Online (Sandbox Code Playgroud)
因此在我的 app.properties 上使用这个元素我只是初始化
spring.datasource.url=jdbc:mysql://bookingrestaurantok.clnhc7kmwszz.us-west-2.rds.amazonaws.com
:3306/restaurant_booking_ok?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=ssssssssssss
spring.datasource.password=sssssssssssssss
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
logging.level.org.hibernate.SQL=debug
Run Code Online (Sandbox Code Playgroud)
我在这里公开工作台数据库及其端点
但每当我尝试到达应用程序中的任何端点时,都会显示“未选择数据库”的错误 500。你能帮我看看我省略了什么步骤吗
我知道有很多代码,但我还附上了我的 pom,以防万一您发现那里有问题
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>cubancoder</groupId>
<artifactId>restaurant-booking</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>restaurant-booking</name>
<description>Demo project for Spring Boot made on maven front end angular</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa …Run Code Online (Sandbox Code Playgroud) 如何访问在 Vue.js 中抛出代理对象的获取响应。从字面上看,我在我的 Vue.js 组件中触发了一个方法,该方法调用连接我的 Vuex 中的 getter 的计算函数,代码如下:
METHOD IN COMPONENT
methods: {
...mapActions(["getAllUsers"]),
async gettingAllusers() {
const target = await this.getterGetAllUsers;
console.log(target);
return target;
},
},
COMPUTED IN COMPONENT
computed: {
...mapGetters(["getterGetAllUsers"]),
getterGetAllUsersFunction() {
return this.$store.getters.getterGetAllUsers;
},
},
VUEX
const store = createStore({
state() {
return {
userRegisteredState: true,
allUsersState: {},
};
},
mutations: {
commit_get_all_users(state, payload) {
state.allUsersState = payload;
console.log(state.allUsersState);
return state.allUsersState;
},
},
getters: {
getterGetAllUsers(state) {
console.log(state);
console.log(state.allUsersState)
return state;
},
},
actions: { …Run Code Online (Sandbox Code Playgroud) javascript ×2
vue.js ×2
angular ×1
busboy ×1
charts ×1
firebase ×1
java ×1
mysql ×1
ng2-charts ×1
proxy ×1
spring-boot ×1
vuejs3 ×1
vuex ×1