[How to Solve Vue warn]: Unknown custom element: did you register the component correctly?

Preface

Copy code
[Vue warn]: Unknown custom element:  did you register the component correctly? For recursive components, make sure to provide the "name" option.

The cause of the problem is: related components are used, but not introduced

Solutions

First find the relevant code caused the error, see if there is use similar components, such as the use radio-groupand radioassembly, but not introduced, this time above error occurs

 <el-form-item label="状态:">
      <el-radio-group v-model="formData.status">
            <el-radio :key="item.value"
            :label="item.value"
            v-for="item in statusOptions" >{{item.label}}</el-radio>
      </el-radio-group>
</el-form-item>

Found in the project directory main.js, and then import {} fromintroduced into related components, re- Vue.use()use. For example:

import {
    Radio,
    RadioGroup,
} from 'element-ui';

Vue.use(Radio);
Vue.use(RadioGroup);

This completes the global introduction of components

Mybatis Error: Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, expect EQ

1. The screenshot of error report is as follows:

2. According to the error report output, check the position after the token, which appears near the ID field. The reason is that after LZ updates the last attribute of the statement, there is an extra comma in front of the where keyword.

3. Solutions

Remove the comma in the red box in the screenshot of step 1.

Pandas Read csv Error tokenizing data. C error: Expected 18 fields in line 173315, saw 20

 Error tokenizing data. C error: Expected 18 fields in line 173315, saw 20

The content of this line is

b55421db8f2f7f9610e7dfc08bcc76e5	Sales consultant listed company with high salary and high commission - 719 \N 1 10000 5000 20190314 20190413 0 -1 null College \N \N Job duties: 1. independent and high quality to complete the reception of visiting customers, to introduce courses and related services, and lead to registration; 2. patient, detailed answers to customer questions of the consultation 3.Explore the potential needs of customers and make accurate recommendations for the courses; 4.Work with the team to complete sales tasks according to the sales target set by the company; 5.Work with other departments to complete the work. Requirements: 1. Good customer service consciousness, good self-motivation; 2. Strong learning ability, active and positive, team spirit; 3. Quick thinking, fast reaction, standard Mandarin; 4. Sales experience is preferred. Benefits: 1. perfect social insurance (five insurance and one gold); 3. position promotion���� clear: course consultant - reserve principal - principal - regional director; 4. training: professional vocational skills training + personalized career promotion guidance; 5. open office environment of the Internet company. ☆ This is a team belonging to young people, this is the platform for you to play, this is your wonderful! Looking forward to growing with you!

Pandas can’t parse
although this line of data can be changed to the correct form after processing, there are 4000 + lines of data with different problems.

Using error_ bad_ Lines = false to solve the problem and ignore the disordered lines

NPM start project error: cannot find module ‘webpack’ problem solution

First install cnpm and then use cnpm i to install the package when stuck and then force to end the download and then install node_modules again after the error error, start the project when npm run serve reported the following error.
The correct approach: If you force to interrupt the download, you should remove the node_modules and reinstall them, no error after the end of the installation means success
PS D:\code\DA_svn\pages\index> npm run serve
> [email protected] serve D:\code\DA_svn\pages\index
vue-cli-service serve
INFO  Starting development server…
ERROR  Error: Cannot find module ‘webpack’
Require stack:
– D:\code\DA_svn\pages\index\node_modules\[email protected]@webpack-dev-server\lib\Server.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\lib\commands\serve.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\lib\Service.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\bin\vue-cli-service.js
Error: Cannot find module ‘webpack’
Require stack:
– D:\code\DA_svn\pages\index\node_modules\[email protected]@webpack-dev-server\lib\Server.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\lib\commands\serve.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\lib\Service.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\bin\vue-cli-service.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\pactera\AppData\Roaming\npm-cache\_logs\2021-03-09T00_59_46_004Z-debug.log

[Solved] #command-line-arguments .\main.go:5:4: no new variables on left side of :=

# command-line-arguments
.\main.go:5:4: no new variables on left side of :=
package main
import “fmt”
func main(){
var b int;
b := 1;
fmt.Println(b);
}

The correct way to write it: remove the : or add a new variable
package main
import “fmt”
func main(){
var b int;
b,a := 1,2;
fmt.Println(b,a);
}
// No compile error is generated at this point because a new variable is declared, because := is a declaration statement

 

Go declares that the local variable does not use command line arguments. Main. Go: 4:6: a declared but not used

Declaring global variables that are not used does not report errors
# command-line-arguments
.\main.go:4:6: a declared but not used
package main
import “fmt”
func main(){
var a string=”hhh”;
var b,c int =1,2
fmt.Println(b,c);
}
Correct writing style:
package main
import “fmt”
func main(){
// var a string=”hhh”;
var b,c int =1,2
fmt.Println(b,c);
}

Error starting vue project these dependencies were not found:create in ./src/router/modules/md.js

Error starting vue project
These dependencies were not found:
* @/views/md/TemplateSetting/create in ./src/router/modules/md.js
* @/views/md/TemplateSetting/index in ./src/router/modules/md.js
To install them, you can run: npm install –save @/views/md/TemplateSetting/create @/views/md/TemplateSetting/index

This is because the create page of the vue project is defined in md.js but the create.vue page is missing so it reports an error

 

Docker run Error: container_linux.go:235: starting container process caused “process_linux.go:258: appl

Error message:
container_ linux.go:235: starting container process caused “process_ linux.go:258: applying cgroup configuration for process caused “Cannot set property TasksAccounting, or unknown property.””
/usr/bin/docker-current: Error response from daemon: oci runtime error: container_ linux.go:235: starting container process caused “process_ linux.go:258: applying cgroup configuration for process caused “Cannot set property TasksAccounting, or unknown prop
After the system is rebooted, the docker cannot be started. After the docker is reloaded, the startup container will report an error, as shown above

reason:

The docker version is not compatible with the operating system version. Upgrade the docker version
I use Yum to install docker. By default, I can only pull to a lower version, so I downloaded RPM docker from the Internet.

Vue2.0: How to Use vue3 api to encapsulate Axios

The biggest difference between vue2 and vue3 is that vue2 uses the options API to compare with the composition API of vue3: aggregate code & amp; Logic reuse

How to use vue3 API to encapsulate Axios in vue2.0:
code directly:
1, create API folder in SRC, and create corresponding file

2, encapsulate some methods in Axios, such as get, post…

// http/axios.js
import instance from "./index"
/**
 * @param {String} method  Methods requested: get, post, delete, put
 * @param {String} url The url of the request:
 * @param {Object} data The parameter of the request.
 * @param {Object} config The configuration of the request.
 * @returns {Promise} returns a promise object, which is actually equivalent to the return value of the axios request data
 */

const axios = ({
    method,
    url,
    data,
    config
}) => {
    method = method.toLowerCase();
    if (method == 'post') {
        return instance.post(url, data, {...config})
    } else if (method == 'get') {
        return instance.get(url, {
            params: data,
            ...config
        })
    } else if (method == 'delete') {
        return instance.delete(url, {
            params: data,
            ...config
        }, )
    } else if (method == 'put') {
        return instance.put(url, data,{...config})
    } else {
        console.error('未知的method' + method)
        return false
    }
}
export default axios

3. Encapsulate some Axios request interception and response interception in the index
here, I basically don’t do any interception, I can add them if I need

// http/index.js
import axios from 'axios'

//Create an instance of axios 
var instance = axios.create({
  baseURL: "http://192.168.0.7:8366", //interface unified domain name
  timeout: 6000, //set timeout
  headers: {
    'Content-Type': 'application/json;charset=UTF-8;',
  }
})
let loading;
//Number of requests being made
let requestCount = 0
//Show loading
const showLoading = () => {
  if (requestCount === 0 && !loading) {
  
  }
  requestCount++;
}
//hidden loading
const hideLoading = () => {
  requestCount--
  if (requestCount == 0) {
  
  }
}

//Request Interceptors 
instance.interceptors.request.use((config) => {
  showLoading()
  // Determine if a token exists before each request is sent, and if it does, add the token to the header of each http request, so you don't have to add it manually for each request
  const token = window.localStorage.getItem('token');
  token && (config.headers.Authorization = token)
  //If the request method is post, the data parameter is converted to a JSON string
  if (config.method === 'POST') {
    config.data = JSON.stringify(config.data);
  }
  return config;
}, (error) =>
  // What to do with request errors
  Promise.reject(error)).

//response interceptor
instance.interceptors.response.use(( response) => {
  hideLoading()
  //response success
  console.log('Interceptor reported an error').
  return response.data;
}, (error) => {
  console.log(error)
  //Response error
  if (error.response && error.response.status) {
    const status = error.response.status
    switch (status) {
      case 400:
        message = 'Request Error';
        break;
      case 401:
        message = 'Request Error';
        break;
      case 404:
        message = 'Error requesting address';
        break;
      case 408:
        message = 'Request timed out';
        break;
      case 500:
        message = 'Internal server error!' ;
        break;
      case 501:
        message = 'Service not implemented!' ;
        break;
      case 502:
        message = 'Gateway error!' ;
        break;
      case 503:
        message = 'Service unavailable!' ;
        break;
      case 504:
        message = 'Gateway timeout!' ;
        break;
      case 505:
        message = 'HTTP version is not supported';
        break;
      default:
        message = 'Request failed'
    }
    ElMessage.error(message);
    return Promise.reject(error);
  }
  return Promise.reject(error);
});


export default instance;

4. Finally, import these files into the NAV file

import axios from "../api/axios"
//Example request
//get
//If you need to wear parameters, you can still use the template string splice `/api/v1/0?id=${id}` and write the id in parentheses
export const mokePostD = (id) => {
    return axios({
        url: '/api/v1/0',
        method: "post",
       	data,
        config: {
            headers: {
                // 'Request-Type': 'wechat'
            },
            timeout: 10000
        }
    })
}
//post
export const mokePost = () => {
    return axios({
        url: '/api/v1/0',
        method: "post",
		data,
        config: {
            headers: {
                // 'Request-Type': 'wechat'
            },
            timeout: 10000
        }
    })
}

5. Page


import { mokePost, mokePostD } from "../../api/nav";
import { ref, onMounted } from "@vue/composition-api";

export default{
	setup(props, { root }){

onMounted(() => {
      mokePost().then((res) => {
        console.log(res);
      
      });

}
	}


}