小编San*_*Nag的帖子

npm run build 后 vue-router 不工作

我有一个 vue 项目,我已经使用 vue cli 安装了它。

我已经安装了 vue-router 并且所有路由在 npm run dev 模式下都可以正常工作。

网址是localhost:8000。之后,我运行npm run build命令,并导航localhost/projet_name到此部署空白页面的 url ,没有路由正在工作。

我正在使用 Windows 系统并在 wampp 服务器上工作。

如果我想使用该项目运行localhost/projet_name我应该怎么做?

这是我运行命令后的文件夹结构npm run build

https://i.stack.imgur.com/HeoTG.png

webpack.config.js 文件是:

var path = require('path')
var webpack = require('webpack')

module.exports = {
  entry: './src/main.js',
  output: {
    path: path.resolve(__dirname, './dist'),
    publicPath: '/dist/',
    filename: 'build.js'
  },
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          'vue-style-loader',
          'css-loader'
        ],
      },      {
        test: /\.vue$/,
        loader: …
Run Code Online (Sandbox Code Playgroud)

webpack vuejs2

7
推荐指数
2
解决办法
8732
查看次数

在没有“ npm run dev”命令的情况下在服务器中运行Vue.js项目?

通过运行全局安装vue cli之后npm install -g vue-cli,我已经通过运行安装了项目文件夹“ myBlog”中的所有模块,npm install并且可以使用在本地环境中运行该项目npm run dev。但是,当我要在实时服务器中移动该项目时,这是npm run dev连续运行批处理程序()的正确方法,还是有其他方法可以npm run dev连续运行该项目?

vuejs2

5
推荐指数
1
解决办法
8034
查看次数

滑动删除不会关闭Swipeable React本机

我正在使用react-native-gesture-handler进行滑动删除目的。它做得很好,但是每当我滑动删除它时,它都会删除该行,但不会关闭Swipeable。我必须向左滑动才能将其关闭。不明白为什么会这样。我在这里提供代码:

import Swipeable from 'react-native-gesture-handler/Swipeable';

    LeftActions = (progress,dragX)=>{
  const scale = dragX.interpolate({
    inputRange: [0, 100],
    outputRange: [0, 1],
    extrapolate: 'clamp',
  });
  return(
    <View style={styles.leftAction}>
      <Animated.Text 
      style={[
          styles.textAction,
          {
            transform:[{
              scale
            }]
          }
        ]}>Delete</Animated.Text>
    </View>
  )
}

class SwipeList extends React.Component {
constructor(props) {
    super(props);
}

SwipeableRow = ({ item, index }) => {
  return (
      <Swipeable
        renderLeftActions={LeftActions}
        renderRightActions={RightActions}
        onSwipeableLeftOpen={()=>this.deleteRow(index)}
      >
        <View style={{paddingHorizontal:10,backgroundColor:'#fff',paddingVertical:20}}>
          <Text style={styles.fromText}>{item.from}</Text>
          <Text numberOfLines={2} style={styles.messageText}>
            {item.message}
          </Text>
        </View>
       </Swipeable>
    );
};
state = {
    list:[
      {
        from: "1", …
Run Code Online (Sandbox Code Playgroud)

react-native

5
推荐指数
2
解决办法
166
查看次数

标签 统计

vuejs2 ×2

react-native ×1

webpack ×1