walid1992 / weex-frame Goto Github PK
View Code? Open in Web Editor NEWweex 基于vue2.0开发框架
weex 基于vue2.0开发框架
执行 weexpack run android 会报错
在android studio 运行的时候总是报network error 的错误,是我的操作步骤错了?那个wxmainactivity 找不到啊
exception function:createInstance, exception:Exception: Error: Cannot find module "..App.vue"
RT
https://market.dotwe.org weex自己的组件库,方便安装。
你好,我运行后web端,ios端和android端效果不一样。是需要设置什么吗?web端是到我的页面,ios端到众筹页面,android端为hello weex。
手机app显示正常,web端运行起来只显示下面的tabbar,内容空白是为什么啊?
h5 启动方式有问题,报错不支持该插件,能不能加qq 990996641
ERROR in ./src/entry/views/userinfo/app.js?entry=true
Module parse failed: D:\workspace-weex\weex-frame\src\entry\views\userinfo\app.js?entry=true Bad character escape sequence (3:37)
You may need an appropriate loader to handle this file type.
SyntaxError: Bad character escape sequence (3:37)
请问是什么原因导致?该如何解决
多谢。
代码都好久没有更新了
Property or method "scrollList" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.
found in
---> at /Users/carson/website/github/weex-frame-0.1.1/src/views/userinfo/app.vue
Uncaught TypeError: Cannot read property 'path' of undefined
我是刚接触weex,没有前端的经验;所以按照你的项目步鄹去部署;出现以下问题(因为我是小白,所以如果有解决办法是否能回答的详细点,万分感谢!):
ERROR in ./src/entry.js
Module build failed: TypeError: fileSystem.statSync is not a function
at module.exports (/Users/ge-boox/Downloads/git_other/weex-frame/node_modules/babel-loader/lib/utils/exists.js:7:25)
at find (/Users/ge-boox/Downloads/git_other/weex-frame/node_modules/babel-loader/lib/resolve-rc.js:13:9)
at Object.module.exports (/Users/ge-boox/Downloads/git_other/weex-frame/node_modules/babel-loader/lib/index.js:113:132)
ERROR in .//weex-vue-loader/lib/script-loader.js!.//babel-loader/lib!./~/weex-vue-loader/lib/selector.js?type=script&index=0!./src/App.vue
Module build failed: TypeError: fileSystem.statSync is not a function
entry.js:1276 [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.
found in
---> at /Users/yinshipeng/Documents/workspace/github/weex-frame/src/views/mine/app.vue
at /Users/yinshipeng/Documents/workspace/github/weex-frame/src/App.web.vue
const globalEvent = weex.requireModule('globalEvent')
export default {
onCollectEvent() {
return new Promise((resolve) => {
globalEvent.addEventListener('collectEvent', event => {
console.log('get geolocation', event)
resolve()
})
})
}
}
调用这个方法提示 cannot read property 'addEventListener' of undefined, globalEvent 这个变量是udnefined
我看了这个项目的源码
//
// ViewController.m
// HackerNews
//
// Created by Hanks on 16/12/8.
// Copyright © 2016年 Weex. All rights reserved.
//
#import "ViewController.h"
#import <WeexSDK/WeexSDK.h>
@interface ViewController ()
@property (nonatomic, strong) WXSDKInstance *instance;
@property (nonatomic, strong) UIView *weexView;
@property (nonatomic, assign) CGFloat weexHeight;
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// [_instance fireGlobalEvent:@"" params:@{}];
// Do any additional setup after loading the view, typically from a nib.
// walid update 高度适配问题
// _weexHeight = self.view.frame.size.height - 20;
_weexHeight = self.view.frame.size.height;
[self.navigationController.navigationBar setHidden:YES];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
statusBar.backgroundColor = [UIColor colorWithRed:1.00 green:0.40 blue:0.00 alpha:1.0];
}
[self render];
}
- (void)dealloc
{
[_instance destroyInstance];
}
- (void)render
{
_instance = [[WXSDKInstance alloc] init];
_instance.viewController = self;
CGFloat width = self.view.frame.size.width;
// walid update 高度适配问题
// _instance.frame = CGRectMake(self.view.frame.size.width-width, 20, width, _weexHeight);
_instance.frame = CGRectMake(self.view.frame.size.width-width, 0, width, _weexHeight);
__weak typeof(self) weakSelf = self;
_instance.onCreate = ^(UIView *view) {
[weakSelf.weexView removeFromSuperview];
weakSelf.weexView = view;
[weakSelf.view addSubview:weakSelf.weexView];
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, weakSelf.weexView);
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTitle:@"刷新" forState:UIControlStateNormal];
[button sizeToFit];
button.frame = CGRectMake(320, 500, 50, 50);
[button addTarget:weakSelf action:@selector(render) forControlEvents:UIControlEventTouchUpInside];
[weakSelf.view addSubview:button];
};
_instance.onFailed = ^(NSError *error) {
NSLog(@"failed %@",error);
};
_instance.renderFinish = ^(UIView *view) {
NSLog(@"render finish");
};
_instance.updateFinish = ^(UIView *view) {
NSLog(@"update Finish");
};
// 加载serve
NSLog(@"url %@",self.url);
[_instance renderWithURL:self.url options:@{@"bundleUrl":[self.url absoluteString]} data:nil];
// 加载本地
// NSString *url = [NSString stringWithFormat:@"file://%@/index.js",[NSBundle mainBundle].bundlePath];
// [_instance renderWithURL:[NSURL URLWithString:url] options:@{@"bundleUrl":url} data:nil];
}
- (UIStatusBarStyle)preferredStatusBarStyle{
return UIStatusBarStyleLightContent;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
是直接把原来的20px给取消了然后我发现网上有方法是
self.automaticallyAdjustsScrollViewInsets = NO;
//
// ViewController.m
// HackerNews
//
// Created by Hanks on 16/12/8.
// Copyright © 2016年 Weex. All rights reserved.
//
#import "ViewController.h"
#import <WeexSDK/WeexSDK.h>
@interface ViewController ()
@property (nonatomic, strong) WXSDKInstance *instance;
@property (nonatomic, strong) UIView *weexView;
@property (nonatomic, assign) CGFloat weexHeight;
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// [_instance fireGlobalEvent:@"" params:@{}];
// Do any additional setup after loading the view, typically from a nib.
_weexHeight = self.view.frame.size.height - 20;
[self.navigationController.navigationBar setHidden:YES];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
statusBar.backgroundColor = [UIColor colorWithRed:7/255.0 green:119/255.0 blue:123/255.0 alpha:1.0];
}
[self render];
}
- (void)dealloc
{
[_instance destroyInstance];
}
- (void)render
{
_instance = [[WXSDKInstance alloc] init];
_instance.viewController = self;
self.automaticallyAdjustsScrollViewInsets = NO;
CGFloat width = self.view.frame.size.width;
_instance.frame = CGRectMake(self.view.frame.size.width-width, 20, width, _weexHeight);
__weak typeof(self) weakSelf = self;
_instance.onCreate = ^(UIView *view) {
[weakSelf.weexView removeFromSuperview];
weakSelf.weexView = view;
[weakSelf.view addSubview:weakSelf.weexView];
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, weakSelf.weexView);
};
_instance.onFailed = ^(NSError *error) {
NSLog(@"failed %@",error);
};
_instance.renderFinish = ^(UIView *view) {
NSLog(@"render finish");
};
_instance.updateFinish = ^(UIView *view) {
NSLog(@"update Finish");
};
NSString *url = [NSString stringWithFormat:@"file://%@/index.js",[NSBundle mainBundle].bundlePath];
[_instance renderWithURL:[NSURL URLWithString:url] options:@{@"bundleUrl":url} data:nil];
}
- (UIStatusBarStyle)preferredStatusBarStyle{
return UIStatusBarStyleLightContent;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
我在自己项目试了也是可以,不是很懂ios,然后想问一下这两种做法有什么区别?
weex-frame-0.1.1 ./start
~/website/github/weex-frame-0.1.1 ~/website/github/weex-frame-0.1.1
[email protected] dev /Users/carson/website/github/weex-frame-0.1.1
webpack --watch
[email protected] serve /Users/carson/website/github/weex-frame-0.1.1
node build/ip.js && serve -p 8080
events.js:160
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::8080
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at Server._listen2 (net.js:1258:14)
at listen (net.js:1294:10)
at Server.listen (net.js:1390:5)
at Function.app.listen (/Users/carson/website/github/weex-frame-0.1.1/node_modules/_connect@2.3.9@connect/lib/proto.js:229:24)
at Object. (/Users/carson/website/github/weex-frame-0.1.1/node_modules/_serve@1.4.0@serve/bin/serve:132:8)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
npm ERR! Darwin 16.5.0
npm ERR! argv "/Users/carson/.nvm/versions/node/v6.10.3/bin/node" "/Users/carson/.nvm/versions/node/v6.10.3/bin/npm" "run" "serve"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] serve: node build/ip.js && serve -p 8080
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script 'node build/ip.js && serve -p 8080'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the weex-frame package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build/ip.js && serve -p 8080
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs weex-frame
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls weex-frame
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/carson/website/github/weex-frame-0.1.1/npm-debug.log
Hash: 929a150176d992f0a542
Version: webpack 1.15.0
Time: 8764ms
Asset Size Chunks Chunk Names
weex/views/404/app.js 117 kB 9 [emitted] views/404/app
weex/App.js 118 kB 0 [emitted] App
weex/components/osc-list/index.js 115 kB 2 [emitted] components/osc-list/index
weex/components/osc-navbar.js 115 kB 3 [emitted] components/osc-navbar
weex/components/osc-navpage.js 115 kB 4 [emitted] components/osc-navpage
weex/components/osc-root.js 115 kB 5 [emitted] components/osc-root
weex/components/osc-scroller/index.js 115 kB 6 [emitted] components/osc-scroller/index
weex/components/osc-tabbar.js 115 kB 7 [emitted] components/osc-tabbar
weex/components/osc-tabitem.js 115 kB 8 [emitted] components/osc-tabitem
weex/App.web.js 118 kB 1 [emitted] App.web
weex/views/home/app.js 115 kB 10 [emitted] views/home/app
weex/views/launch/app.js 115 kB 11 [emitted] views/launch/app
weex/views/list/app.js 115 kB 12 [emitted] views/list/app
weex/views/mine/app.js 115 kB 13 [emitted] views/mine/app
weex/views/personal/app.js 115 kB 14 [emitted] views/personal/app
weex/views/scroller/app.js 115 kB 15 [emitted] views/scroller/app
weex/views/userinfo/app.js 115 kB 16 [emitted] views/userinfo/app
weex/views/web/app.js 115 kB 17 [emitted] views/web/app
[0] ./src/entry/views/mine/app.js?entry=true 535 bytes {13} [built]
[0] ./src/entry/App.js?entry=true 518 bytes {0} [built]
[0] ./src/entry/views/userinfo/app.js?entry=true 539 bytes {16} [built]
[0] ./src/entry/views/scroller/app.js?entry=true 539 bytes {15} [built]
[0] ./src/entry/views/personal/app.js?entry=true 539 bytes {14} [built]
[0] ./src/entry/views/web/app.js?entry=true 534 bytes {17} [built]
[0] ./src/entry/views/list/app.js?entry=true 535 bytes {12} [built]
[0] ./src/entry/views/launch/app.js?entry=true 537 bytes {11} [built]
[0] ./src/entry/views/home/app.js?entry=true 535 bytes {10} [built]
[0] ./src/entry/views/404/app.js?entry=true 534 bytes {9} [built]
[0] ./src/entry/App.web.js?entry=true 522 bytes {1} [built]
+ 92 hidden modules
Hash: 0e5fcffd81f1c837ac67
Version: webpack 1.15.0
Time: 8960ms
Asset Size Chunks Chunk Names
entry.js 431 kB 0 [emitted] entry
+ 115 hidden modules
Hash: 929a150176d992f0a542
Version: webpack 1.15.0
Time: 112ms
Asset Size Chunks Chunk Names
weex/views/404/app.js 117 kB 9 [emitted] views/404/app
weex/App.js 118 kB 0 [emitted] App
weex/components/osc-list/index.js 115 kB 2 [emitted] components/osc-list/index
weex/components/osc-navbar.js 115 kB 3 [emitted] components/osc-navbar
weex/components/osc-navpage.js 115 kB 4 [emitted] components/osc-navpage
weex/components/osc-root.js 115 kB 5 [emitted] components/osc-root
weex/components/osc-scroller/index.js 115 kB 6 [emitted] components/osc-scroller/index
weex/components/osc-tabbar.js 115 kB 7 [emitted] components/osc-tabbar
weex/components/osc-tabitem.js 115 kB 8 [emitted] components/osc-tabitem
weex/App.web.js 118 kB 1 [emitted] App.web
weex/views/home/app.js 115 kB 10 [emitted] views/home/app
weex/views/launch/app.js 115 kB 11 [emitted] views/launch/app
weex/views/list/app.js 115 kB 12 [emitted] views/list/app
weex/views/mine/app.js 115 kB 13 [emitted] views/mine/app
weex/views/personal/app.js 115 kB 14 [emitted] views/personal/app
weex/views/scroller/app.js 115 kB 15 [emitted] views/scroller/app
weex/views/userinfo/app.js 115 kB 16 [emitted] views/userinfo/app
weex/views/web/app.js 115 kB 17 [emitted] views/web/app
+ 103 hidden modules
先执行以下 npm install 呢
qs.js
您好,下载了项目,执行完npm run build之后,提示错误:
ERROR in ./src/entry/App.js?entry=true
Module not found: Error: Cannot resolve module '..App.vue' in F:\linkpal\weexProject\weex-frame-master\src\entry
@ ./src/entry/App.js?entry=true 8:12-33
ERROR in ./src/entry/components/osc-navbar.js?entry=true
Module not found: Error: Cannot resolve module '....componentsosc-navbar.vue' in F:\linkpal\weexProject\weex-frame-m
aster\src\entry\components
@ ./src/entry/components/osc-navbar.js?entry=true 8:12-54
ERROR in ./src/entry/components/osc-navpage.js?entry=true
Module not found: Error: Cannot resolve module '....componentsosc-navpage.vue' in F:\linkpal\weexProject\weex-frame-
master\src\entry\components
@ ./src/entry/components/osc-navpage.js?entry=true 8:12-55
ERROR in ./src/entry/components/osc-root.js?entry=true
Module not found: Error: Cannot resolve module '....componentsosc-root.vue' in F:\linkpal\weexProject\weex-frame-mas
ter\src\entry\components
@ ./src/entry/components/osc-root.js?entry=true 8:12-52
ERROR in ./src/entry/components/osc-tabbar.js?entry=true
Module not found: Error: Cannot resolve module '....componentsosc-tabbar.vue' in F:\linkpal\weexProject\weex-frame-m
aster\src\entry\components
@ ./src/entry/components/osc-tabbar.js?entry=true 8:12-54
ERROR in ./src/entry/views/home/app.js?entry=true
Module not found: Error: Cannot resolve module '......�iewshomeapp.vue' in F:\linkpal\weexProject\weex-frame-master\
src\entry\views\home
@ ./src/entry/views/home/app.js?entry=true 8:12-50
ERROR in ./src/entry/components/osc-tabitem.js?entry=true
Module not found: Error: Cannot resolve module '....componentsosc-tabitem.vue' in F:\linkpal\weexProject\weex-frame-
master\src\entry\components
@ ./src/entry/components/osc-tabitem.js?entry=true 8:12-55
ERROR in ./src/entry/views/launch/app.js?entry=true
Module not found: Error: Cannot resolve module '......�iewslaunchapp.vue' in F:\linkpal\weexProject\weex-frame-maste
r\src\entry\views\launch
@ ./src/entry/views/launch/app.js?entry=true 8:12-52
ERROR in ./src/entry/views/mine/app.js?entry=true
Module not found: Error: Cannot resolve module '......�iewsmineapp.vue' in F:\linkpal\weexProject\weex-frame-master\
src\entry\views\mine
@ ./src/entry/views/mine/app.js?entry=true 8:12-50
ERROR in ./src/entry/views/web/app.js?entry=true
Module not found: Error: Cannot resolve module '......�iewswebapp.vue' in F:\linkpal\weexProject\weex-frame-master\s
rc\entry\views\web
@ ./src/entry/views/web/app.js?entry=true 8:12-49
我是先下载项目,解压,执行npm install,然后npm run build,请问是哪一步出错了吗?
ERROR in ./src/utils/modules/navigator.js
Module not found: Error: Cannot resolve 'file' or 'directory' E:\weex\weex-frame\config in E:\weex\weex-frame\src\utils\modules
@ ./src/utils/modules/navigator.js 17:14-31
ERROR in ./src/entry/views/userinfo/app.js?entry=true
Module parse failed: E:\weex\weex-frame\src\entry\views\userinfo\app.js?entry=true Bad character escape sequence (8:37)
You may need an appropriate loader to handle this file type.
SyntaxError: Bad character escape sequence (8:37)
ERROR in ./src/entry/App.js?entry=true
Module not found: Error: Cannot resolve module '..App.vue' in E:\weex\weex-frame\src\entry
@ ./src/entry/App.js?entry=true 8:12-33
ERROR in ./src/entry/components/osc-navbar.js?entry=true
Module not found: Error: Cannot resolve module '....componentsosc-navbar.vue' in E:\weex\weex-frame\src\entry\components
@ ./src/entry/components/osc-navbar.js?entry=true 8:12-54
ERROR in ./src/entry/components/osc-tabitem.js?entry=true
Module not found: Error: Cannot resolve module '....componentsosc-tabitem.vue' in E:\weex\weex-frame\src\entry\components
@ ./src/entry/components/osc-tabitem.js?entry=true 8:12-55
ERROR in ./src/entry/App.web.js?entry=true
Module not found: Error: Cannot resolve module '..App.web.vue' in E:\weex\weex-frame\src\entry
@ ./src/entry/App.web.js?entry=true 8:12-37
后面还有一堆
执行 ./start 后浏览器能打开页面,但是下面app.weex.js不存在,dist目录下面没有这个文件,请求这个文件是怎么生成的? 文档里没有说明
@walid1992 作者你好。仔细看了一下你的框架,有一个问题想请你指教一下。
如果自定义组件,你的方式是在webpack里面自己生成全局的注册组件的代码,然后再使用组件,如下图。
那么如果我想定义一个button,命名lo_btn的components的话,是否需要也将其全局注册到你所定义的webpack上述代码中,如果自定义组件过多,全局注册的组件岂不是会很多,怎么样能够单个自定义组件然后引入呢?
我试了一个自定义的button,最后引入的时候存在button不能正常显示的情况。
望指教,谢谢。
麻烦大神解答一下,使用npm run serve 执行后,页面不出来,显示dist/web/entry.js 404 ,是什么问题
想问下 这种方案存在以下问题,不知道你是怎么解决的
多个vue()之间如何广播(通知)。
多个vue之间,怎么处理全局变量(比如用户状态信息)
你项目中的bridge是如何使用的
缺少了文件:platform/ios/WeexFrame/IpDefine.h
从前几天的code里找回来了
我@import一个公共的css,采用cssnext写法,如:root{--maincolor:red},但是运行后并不能解析,除非写在当前的css文件中才能解析,如果这样,写公共的css就没啥用了
项目中源码部分都是 unix风格 webpack.config.js 又是windows 风格 没冲突吗?
Pod installation complete! There are 3 dependencies from the Podfile and 3 total pods installed.
? Choose one of the following devices iPhone 4s ios: 9.0
project is building ...
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ id:A532F501-2D34-48BF-A065-2B470D141531 }
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ id:A532F501-2D34-48BF-A065-2B470D141531 }
User defaults from command line:
IDEDerivedDataPathOverride = /Users/blue/Sites/lens/platforms/ios/build
Build settings from command line:
SDKROOT = iphonesimulator9.0
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ id:A532F501-2D34-48BF-A065-2B470D141531 }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.