oc 与 js交互之vue.js

  • 时间:
  • 浏览:1
  • 来源:uu快3IOS下载_uu快3app下载_和值

            adver.pictureId = [specialId longLongValue];

//

    _urlString =urlString;

@property (strong, nonatomic) UIWebView *webView;

    self = [super initWithFrame:frame];

{

    }

@property (nonatomic, strong) JSContext *jsContext;

    });

            vc.adver = adver;

//  HDSpecialViewController.h

    [self call];

//

    str=@"https://xxxxxxxxxxxxx/special.html#/";

{

- (void)cleanCacheAndCookie

//  headhunter

    // 以前在回调js的法律最好的办法Callback把内容传出去

},

}

            adver.type = [type longLongValue];

@implementation SpecialJsModel

        context.exception = exceptionValue;

    //清除cookies

    self.jsContext[@"mobileObject"] = model;

    return self;

@end

    [self.webView stringByEvaluatingJavaScriptFromString:@"localStorage.clear();"];

-(void)setUrlString:(NSString *)urlString

    self.title = [webView stringByEvaluatingJavaScriptFromString:@"document.title"];

   //实现移动端法律最好的办法

#import <JavaScriptCore/JavaScriptCore.h>

//

- (void)webViewDidFinishLoad:(UIWebView *)webView

    self.jsContext = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];

{

    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];  

    model.jsContext = self.jsContext;

    [cache removeAllCachedResponses];

- (instancetype)initWithFrame:(CGRect)frame withViewController:(UIViewController *)viewController;

       }

    return YES;

@property (strong, nonatomic) NSString *urlString;

#import "HDHotSearchViewController.h"

    [self cleanCacheAndCookie];

    if (self) {

//

        }

    [MBProgressHUD hideHUDInView:self.viewController.view];

}

    {

#ifdef __DEBUG

//

随意在组件中需用特殊防止,让组件的法律最好的办法挂载到window的mobileChangeContent法律最好的办法上

            HDHotSearchViewController * vc = [[HDHotSearchViewController alloc]init];

//  Copyright © 2017年 HunterOn. All rights reserved.

    //清除UIWebView的缓存

    [myWebView loadRequest:[NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:120]];

}

}

//JS调用此法律最好的办法进入高端专场

    _urlString=request.URL.absoluteString;

            [self.vc.navigationController pushViewController:vc animated:YES];

在webViewDidFinishLoad 代理法律最好的办法中调用,可能性這個以前vue的所有的组件节点都可能性渲染

@end

{

1、注意大伙儿儿都知道调用vue的法律最好的办法的以需用挂载到window上的法律最好的办法

}

    JSValue *Callback = self.jsContext[@"mobileChangeContent"];

        self.jsContext = [[JSContext alloc] init];

//

        NSLog(@"异常信息:%@", exceptionValue);

methods: {

//  Copyright © 2017年 HunterOn. All rights reserved.

@property (nonatomic,strong) UIViewController * viewController;

{

    dispatch_async(dispatch_get_main_queue(), ^{

    SpecialJsModel *model  = [[SpecialJsModel alloc] init];

//清空缓存

/**清除缓存和cookie*/

}

    NSString *str=nil;

    NSURLCache * cache = [NSURLCache sharedURLCache];

    str=@"https://xxxxxxxxxxxxx/special.html#/";

     window.mobileChangeContent = this.mobileChangeContent;

    //传值给web端

    //该法律最好的办法是vue中组件的法律最好的办法

@property (nonatomic, weak) UIWebView *webView;

@end

    //去除长按后再次总出 的文本选则框  

@interface SpecialJsModel : NSObject <specialJavaScriptDelegate>

@end

        [storage deleteCookie:cookie];

   mobileChangeContent(level){

    myWebView.delegate =self;

@implementation HDSpecialView

//  HDSpecialViewController.m

//  Created by peter.zhang on 2017/11/20.

mounted(){

       if(level){

    }

- (void)webViewDidFinishLoad:(UIWebView *)webView

    [Callback callWithArguments:@[@"4"]];

二、oc调用vue.js 组件的法律最好的办法

    self.jsContext.exceptionHandler = ^(JSContext *context, JSValue *exceptionValue) {

@end

    //正式环境

    self.jsContext = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];

-(void)initWebView

#import "HDSpecialView.h"

vue中的实现mobileChangeContent(参数)的法律最好的办法

    [cache setDiskCapacity:0];

@protocol specialJavaScriptDelegate <JSExport>

}

.m文件

- (instancetype)initWithFrame:(CGRect)frame withViewController:(UIViewController *)viewController{

    for (cookie in [storage cookies])

#import "WebViewController.h"

}

    UIWebView *myWebView=[[UIWebView alloc] initWithFrame:CGRectMake(0, 0,kScreen_Width,kScreen_Height-kHeight_NavBar - kHeight_TabBar)];

}

            Adver *adver = [[Adver alloc]init];

    self.webView=myWebView;

        if (specialId&&![specialId isEqualToString:@""]) {

    //测试环境

{

#else

@interface HDSpecialView:UIView <UIWebViewDelegate>

    [self addSubview:myWebView];

//  Created by peter.zhang on 2017/11/20.

    [cache setMemoryCapacity:0];

-(void)goToSpecial:(NSString *)specialId type:(NSString *)type

//  headhunter

    model.vc = self.viewController;

    myWebView.backgroundColor = kColor_BackGround;

    NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];

    NSHTTPCookie *cookie;

        self.viewController = viewController;

        self.backgroundColor =[UIColor whiteColor];

#endif

@property (nonatomic, weak) JSContext *jsContext;

    };

    }

    model.webView = self.webView;

@end

@property (nonatomic,strong) UIViewController *vc;

-(void)clearCacheAndCookie

//初始化

@interface HDSpecialView ()

- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType

组件A

}

}

-(void)goToSpecial:(NSString *)specialId type:(NSString *)type;

{

    NSURL *url=[NSURL URLWithString:str];

- (void)call{

{

- (void)clearCacheAndCookie;

        [self initWebView];