首先创建一个农历文件

LunarCalendar.h

 //
// LunarCalendar.h
// Hnair4iPhone
//
// Created by yingkong1987 on 13-10-10.
// Copyright (c) 2013年 yingkong1987. All rights reserved.
// #import <Foundation/Foundation.h> struct SolarTerm
{
__unsafe_unretained NSString *solarName;
int solarDate;
}; @interface LunarCalendar : NSObject
{
NSArray *HeavenlyStems;
NSArray *EarthlyBranches;
NSArray *LunarZodiac;
NSArray *SolarTerms;
NSArray *arrayMonth;
NSArray *arrayDay; NSDate *thisdate; int year;
int month;
int day; int lunarYear; //农历年
int lunarMonth; //农历月
int doubleMonth; //闰月
bool isLeap; //是否闰月标记
int lunarDay; //农历日 struct SolarTerm solarTerm[]; NSString *yearHeavenlyStem;
NSString *monthHeavenlyStem;
NSString *dayHeavenlyStem; NSString *yearEarthlyBranch;
NSString *monthEarthlyBranch;
NSString *dayEarthlyBranch; NSString *monthLunar;
NSString *dayLunar; NSString *zodiacLunar; NSString *solarTermTitle;
} -(void)loadWithDate:(NSDate *)date; -(void)InitializeValue;
-(int)LunarYearDays:(int)y;
-(int)DoubleMonth:(int)y;
-(int)DoubleMonthDays:(int)y;
-(int)MonthDays:(int)y :(int)m;
-(void)ComputeSolarTerm; -(double)Term:(int)y :(int)n :(bool)pd;
-(double)AntiDayDifference:(int)y :(double)x;
-(double)EquivalentStandardDay:(int)y :(int)m :(int)d;
-(int)IfGregorian:(int)y :(int)m :(int)d :(int)opt;
-(int)DayDifference:(int)y :(int)m :(int)d;
-(double)Tail:(double)x; -(NSString *)MonthLunar;
-(NSString *)DayLunar;
-(NSString *)ZodiacLunar;
-(NSString *)YearHeavenlyStem;
-(NSString *)MonthHeavenlyStem;
-(NSString *)DayHeavenlyStem;
-(NSString *)YearEarthlyBranch;
-(NSString *)MonthEarthlyBranch;
-(NSString *)DayEarthlyBranch;
-(NSString *)SolarTermTitle;
-(bool)IsLeap;
-(int)GregorianYear;
-(int)GregorianMonth;
-(int)GregorianDay;
-(int)Weekday;
-(NSString *)Constellation; @end @interface NSDate (LunarCalendar) /****************************************************
*@Description:获得NSDate对应的中国日历(农历)的NSDate
*@Params:nil
*@Return:NSDate对应的中国日历(农历)的LunarCalendar
****************************************************/
- (LunarCalendar *)chineseCalendarDate; @end

LunarCalendar.m

 //
// LunarCalendar.m
// Hnair4iPhone
//
// Created by yingkong1987 on 13-10-10.
// Copyright (c) 2013年 yingkong1987. All rights reserved.
// #import "LunarCalendar.h" int LunarCalendarInfo[] = { 0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,
0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,
0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,
0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,
0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,
0x06ca0,0x0b550,0x15355,0x04da0,0x0a5b0,0x14573,0x052b0,0x0a9a8,0x0e950,0x06aa0,
0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,
0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b6a0,0x195a6,
0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,
0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0,
0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,
0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,
0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,
0x05aa0,0x076a3,0x096d0,0x04bd7,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,
0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0,
0x14b63}; @implementation LunarCalendar -(id)init
{
HeavenlyStems = [NSArray arrayWithObjects:@"甲",@"乙",@"丙",@"丁",@"戊",@"己",@"庚",@"辛",@"壬",@"癸",nil];
EarthlyBranches = [NSArray arrayWithObjects:@"子",@"丑",@"寅",@"卯",@"辰",@"巳",@"午",@"未",@"申",@"酉",@"戌",@"亥",nil];
LunarZodiac = [NSArray arrayWithObjects:@"鼠",@"牛",@"虎",@"兔",@"龙",@"蛇",@"马",@"羊",@"猴",@"鸡",@"狗",@"猪",nil]; SolarTerms = [NSArray arrayWithObjects:@"立春", @"雨水", @"惊蛰", @"春分", @"清明", @"谷雨", @"立夏", @"小满", @"芒种", @"夏至", @"小暑", @"大暑", @"立秋", @"处暑", @"白露", @"秋分", @"寒露", @"霜降", @"立冬", @"小雪", @"大雪", @"冬至", @"小寒", @"大寒", nil]; arrayMonth = [NSArray arrayWithObjects:@"正月", @"二月", @"三月", @"四月", @"五月", @"六月", @"七月", @"八月", @"九月", @"十月", @"冬月", @"腊月", nil]; arrayDay = [NSArray arrayWithObjects:@"初一", @"初二", @"初三", @"初四", @"初五", @"初六", @"初七", @"初八", @"初九", @"初十", @"十一", @"十二", @"十三", @"十四", @"十五", @"十六", @"十七", @"十八", @"十九", @"二十", @"廿一", @"廿二", @"廿三", @"廿四", @"廿五", @"廿六", @"廿七", @"廿八", @"廿九", @"三十", @"三一", nil]; return self;
} -(void)loadWithDate:(NSDate *)adate
{
if (adate == nil)
[self loadWithDate:[NSDate date]];
else
{
HeavenlyStems = [NSArray arrayWithObjects:@"甲",@"乙",@"丙",@"丁",@"戊",@"己",@"庚",@"辛",@"壬",@"癸",nil];
EarthlyBranches = [NSArray arrayWithObjects:@"子",@"丑",@"寅",@"卯",@"辰",@"巳",@"午",@"未",@"申",@"酉",@"戌",@"亥",nil];
LunarZodiac = [NSArray arrayWithObjects:@"鼠",@"牛",@"虎",@"兔",@"龙",@"蛇",@"马",@"羊",@"猴",@"鸡",@"狗",@"猪",nil]; SolarTerms = [NSArray arrayWithObjects:@"立春", @"雨水", @"惊蛰", @"春分", @"清明", @"谷雨", @"立夏", @"小满", @"芒种", @"夏至", @"小暑", @"大暑", @"立秋", @"处暑", @"白露", @"秋分", @"寒露", @"霜降", @"立冬", @"小雪", @"大雪", @"冬至", @"小寒", @"大寒", nil]; arrayMonth = [NSArray arrayWithObjects:@"正月", @"二月", @"三月", @"四月", @"五月", @"六月", @"七月", @"八月", @"九月", @"十月", @"冬月", @"腊月", nil]; arrayDay = [NSArray arrayWithObjects:@"初一", @"初二", @"初三", @"初四", @"初五", @"初六", @"初七", @"初八", @"初九", @"初十", @"十一", @"十二", @"十三", @"十四", @"十五", @"十六", @"十七", @"十八", @"十九", @"二十", @"廿一", @"廿二", @"廿三", @"廿四", @"廿五", @"廿六", @"廿七", @"廿八", @"廿九", @"三十", @"三一", nil]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
[dateFormatter setTimeStyle:NSDateFormatterNoStyle]; [dateFormatter setDateFormat:@"yyyy"];
year = [[dateFormatter stringFromDate:adate] intValue]; [dateFormatter setDateFormat:@"MM"];
month = [[dateFormatter stringFromDate:adate] intValue]; [dateFormatter setDateFormat:@"dd"];
day = [[dateFormatter stringFromDate:adate] intValue]; thisdate = adate;
}
} -(void)InitializeValue
{
NSString *start = @"1900-01-31";
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
NSString *end = [dateFormatter stringFromDate:thisdate]; NSDateFormatter *f = [[NSDateFormatter alloc] init];
[f setDateFormat:@"yyyy-MM-dd"];
NSDate *startDate = [f dateFromString:start];
NSDate *endDate = [f dateFromString:end]; NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *components = [gregorianCalendar components:NSDayCalendarUnit fromDate:startDate toDate:endDate options:]; int dayCyclical=(([components day] + )/(/(*)))+; int sumdays = [components day]; int tempdays = ; //计算农历年
for (lunarYear = ; lunarYear < && sumdays > ; lunarYear++)
{
tempdays = [self LunarYearDays:lunarYear];
sumdays -= tempdays;
} if (sumdays < )
{
sumdays += tempdays;
lunarYear--;
} //计算闰月
doubleMonth = [self DoubleMonth:lunarYear];
isLeap = false; //计算农历月
for (lunarMonth = ; lunarMonth < && sumdays > ; lunarMonth++)
{
//闰月
if (doubleMonth > && lunarMonth == (doubleMonth + ) && isLeap == false)
{
--lunarMonth;
isLeap = true;
tempdays = [self DoubleMonthDays:lunarYear];
}
else
{
tempdays = [self MonthDays:lunarYear:lunarMonth];
} //解除闰月
if (isLeap == true && lunarMonth == (doubleMonth + ))
{
isLeap = false;
}
sumdays -= tempdays;
} //计算农历日
if (sumdays == && doubleMonth > && lunarMonth == doubleMonth + )
{
if (isLeap)
{
isLeap = false;
}
else
{
isLeap = true;
--lunarMonth;
}
} if (sumdays < )
{
sumdays += tempdays;
--lunarMonth;
} lunarDay = sumdays + ; //计算节气
[self ComputeSolarTerm]; solarTermTitle = @"";
for (int i=; i<; i++)
{
NSDateFormatter *currentFormatter = [[NSDateFormatter alloc] init]; [currentFormatter setDateFormat:@"yyyyMMdd"]; if (solarTerm[i].solarDate == [[currentFormatter stringFromDate:thisdate] intValue])
solarTermTitle = solarTerm[i].solarName;
} monthLunar = (NSString *)[arrayMonth objectAtIndex:(lunarMonth - )];
dayLunar = (NSString *)[arrayDay objectAtIndex:(lunarDay - )];
zodiacLunar = (NSString *)[LunarZodiac objectAtIndex:((lunarYear - ) % % )]; yearHeavenlyStem = (NSString *)[HeavenlyStems objectAtIndex:((lunarYear - ) % % )];
if ((((year-)*+month+)%) == )
monthHeavenlyStem = (NSString *)[HeavenlyStems objectAtIndex:];
else
monthHeavenlyStem = (NSString *)[HeavenlyStems objectAtIndex:(((year-)*+month+)%-)]; dayHeavenlyStem = (NSString *)[HeavenlyStems objectAtIndex:(dayCyclical%)]; yearEarthlyBranch = (NSString *)[EarthlyBranches objectAtIndex:((lunarYear - ) % % )];
if ((((year-)*+month+)%) == )
monthEarthlyBranch = (NSString *)[EarthlyBranches objectAtIndex:];
else
monthEarthlyBranch = (NSString *)[EarthlyBranches objectAtIndex:(((year-)*+month+)%-)];
dayEarthlyBranch = (NSString *)[EarthlyBranches objectAtIndex:(dayCyclical%)];
} -(int)LunarYearDays:(int)y
{
int i, sum = ;
for (i = 0x8000; i > 0x8; i >>= )
{
if ((LunarCalendarInfo[y - ] & i) != )
sum += ;
}
return (sum + [self DoubleMonthDays:y]);
} -(int)DoubleMonth:(int)y
{
return (LunarCalendarInfo[y - ] & 0xf);
} ///返回农历年闰月的天数
-(int)DoubleMonthDays:(int)y
{
if ([self DoubleMonth:y] != )
return (((LunarCalendarInfo[y - ] & 0x10000) != ) ? : );
else
return ();
} ///返回农历年月份的总天数
-(int)MonthDays:(int)y :(int)m
{
return (((LunarCalendarInfo[y - ] & (0x10000 >> m)) != ) ? : );
} -(void)ComputeSolarTerm
{
for (int n = month * - ; n <= month * ; n++)
{
double Termdays = [self Term:year:n:YES];
double mdays = [self AntiDayDifference:year:floor(Termdays)];
//double sm1 = floor(mdays / 100);
int hour = (int)floor((double)[self Tail:Termdays] * );
int minute = (int)floor((double)([self Tail:Termdays] * - hour) * );
int tMonth = (int)ceil((double)n / );
int tday = (int)mdays % ; if (n >= )
solarTerm[n - month * + ].solarName = [SolarTerms objectAtIndex:(n - )];
else
solarTerm[n - month * + ].solarName = [SolarTerms objectAtIndex:(n + )]; NSDateComponents *components = [[NSDateComponents alloc] init];
[components setYear:year];
[components setMonth:tMonth];
[components setDay:tday];
[components setHour:hour];
[components setMinute:minute]; NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDate *ldate = [gregorian dateFromComponents:components]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyyMMdd"]; solarTerm[n - month * + ].solarDate = [[dateFormatter stringFromDate:ldate] intValue];
}
} -(double)Tail:(double)x
{
return x - floor(x);
} -(double)Term:(int)y :(int)n :(bool)pd
{
//儒略日
double juD = y * (365.2423112 - 6.4e-14 * (y - ) * (y - ) - 3.047e-8 * (y - )) + 15.218427 * n + 1721050.71301; //角度
double tht = 3e- * y - 0.372781384 - 0.2617913325 * n; //年差实均数
double yrD = (1.945 * sin(tht) - 0.01206 * sin( * tht)) * (1.048994 - 2.583e-5 * y); //朔差实均数
double shuoD = -18e- * sin(2.313908653 * y - 0.439822951 - 3.0443 * n); double vs = (pd) ? (juD + yrD + shuoD - [self EquivalentStandardDay:y::] - ) : (juD - [self EquivalentStandardDay:y::] - );
return vs;
} -(double)AntiDayDifference:(int)y :(double)x
{
int m = ;
for (int j = ; j <= ; j++)
{
int mL = [self DayDifference:y:(j+):] - [self DayDifference:y:j:];
if (x <= mL || j == )
{
m = j;
break;
}
else
x -= mL;
}
return * m + x;
} -(double)EquivalentStandardDay:(int)y :(int)m :(int)d
{
//Julian的等效标准天数
double v = (y - ) * + floor((double)((y - ) / )) + [self DayDifference:y:m:d] - ; if (y > )
{//Gregorian的等效标准天数
v += -floor((double)((y - ) / )) + floor((double)((y - ) / )) + ;
}
return v;
} -(int)DayDifference:(int)y :(int)m :(int)d
{
int ifG = [self IfGregorian:y:m:d:];
//NSArray *monL = [NSArray arrayWithObjects:, nil];
NSInteger monL[] = {, , , , , , , , , , , , };
if (ifG == )
{
if ((y % != && y % == ) || (y % == ))
monL[] += ;
else
{
if (y % == )
monL[] += ;
}
} int v = ; for (int i = ; i <= m - ; i++)
v += monL[i]; v += d;
if (y == )
{
if (ifG == )
v -= ;
if (ifG == -)
v = ; //infinity
}
return v;
} -(int)IfGregorian:(int)y :(int)m :(int)d :(int)opt
{
if (opt == )
{
if (y > || (y == && m > ) || (y == && m == && d > ))
return (); //Gregorian
else
if (y == && m == && d >= && d <= )
return (-); //空
else
return (); //Julian
} if (opt == )
return (); //Gregorian
if (opt == )
return (); //Julian
return (-);
} -(NSString *)MonthLunar
{
return monthLunar;
} -(NSString *)DayLunar
{
return dayLunar;
} -(NSString *)ZodiacLunar
{
return zodiacLunar;
} -(NSString *)YearHeavenlyStem
{
return yearHeavenlyStem;
} -(NSString *)MonthHeavenlyStem
{
return monthHeavenlyStem;
} -(NSString *)DayHeavenlyStem
{
return dayHeavenlyStem;
} -(NSString *)YearEarthlyBranch
{
return yearEarthlyBranch;
} -(NSString *)MonthEarthlyBranch
{
return monthEarthlyBranch;
} -(NSString *)DayEarthlyBranch
{
return dayEarthlyBranch;
} -(NSString *)SolarTermTitle
{
return solarTermTitle;
} -(bool)IsLeap
{
return isLeap;
} -(int)GregorianYear
{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy"];
int ret = [[formatter stringFromDate:thisdate] intValue]; return ret;
} -(int)GregorianMonth
{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MM"];
int ret = [[formatter stringFromDate:thisdate] intValue]; return ret;
} -(int)GregorianDay
{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"dd"];
int ret = [[formatter stringFromDate:thisdate] intValue]; return ret;
} -(int)Weekday
{
NSCalendar* cal = [NSCalendar currentCalendar];
NSDateComponents* weekday = [cal components:NSWeekdayCalendarUnit fromDate:thisdate];
return [weekday weekday];
} -(NSString *)Constellation
{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MMdd"];
int intConstellation = [[formatter stringFromDate:thisdate] intValue]; if (intConstellation >= && intConstellation <= )
return @"Aquarius";
else if (intConstellation >= && intConstellation <= )
return @"Pisces";
else if (intConstellation >= && intConstellation <= )
return @"Aries";
else if (intConstellation >= && intConstellation <= )
return @"Taurus";
else if (intConstellation >= && intConstellation <= )
return @"Gemini";
else if (intConstellation >= && intConstellation <= )
return @"Cancer";
else if (intConstellation >= && intConstellation <= )
return @"Leo";
else if (intConstellation >= && intConstellation <= )
return @"Virgo";
else if (intConstellation >= && intConstellation <= )
return @"Libra";
else if (intConstellation >= && intConstellation <= )
return @"Scorpio";
else if (intConstellation >= && intConstellation <= )
return @"Sagittarius";
else
return @"Capricorn";
} @end @implementation NSDate (LunarCalendar) /****************************************************
*@Description:获得NSDate对应的中国日历(农历)的NSDate
*@Params:nil
*@Return:NSDate对应的中国日历(农历)的LunarCalendar
****************************************************/
- (LunarCalendar *)chineseCalendarDate
{
LunarCalendar *lunarCalendar = [[LunarCalendar alloc] init];
[lunarCalendar loadWithDate:self];
[lunarCalendar InitializeValue]; return lunarCalendar;
} @end

然后以我昨天使用的TimesSquare为例.

先找到每个日期按钮生成的地方.TimesSquare日历的就是在TSQCalendarRowCell的createDayButtons方法.

找到后,在里面增加一个label.如红框所示

记得import刚创建的农历文件LunarCalendar.h

然后如红框使用

效果如图:

iOS 给三方日历加上农历的更多相关文章

  1. iOS 常用三方类库整理

    iOS 常用三方类库整理 1:基于响应式编程思想的oc 地址:https://github.com/ReactiveCocoa/ReactiveCocoa 2:hud提示框 地址:https://gi ...

  2. Google日历添加农历、节日和天气插件(步骤)

    Google日历添加农历.节日和天气插件(步骤) Google功能非常多,Google日历只是其中一个,而且支持Exchange账户(iPhone,WP7,诺基亚等)和Google账户登录(andro ...

  3. 设置代码ios 6添加日历事件No calendar has been set.错误

    查了好多资料,发明还是不全,干脆自己整理吧,至少保证在我的做法正确的,以免误导读者,也是给自己做个记录吧! 在iOS 6做日历事件添加时,来来回回报错,No calendar has been set ...

  4. iOS 常用三方(持续更新)

    iOS 常用三方 1.ZWMSegmentController 分页控制器 https://github.com/weiming4219/ZWMSegmentController

  5. WP8日历(含农历)APP

    WP8日历(含农历)APP WP8日历(含农历)APP UI XAML(部分) <phone:PhoneApplicationPage xmlns:CustomControl="clr ...

  6. iOS日历显示农历信息

    第一次接触到日历的开发,表示需要学习的东西还有很多呢! 关于日历的开发,如果不进行相关设置的话,默认是没有农历的,需要我们进行设置. 核心Demo如下: monthArr = [NSArray arr ...

  7. iOS - OC NSCalendar 日历

    前言 @interface NSCalendar : NSObject <NSCopying, NSSecureCoding> NSCalendar 对世界上现存的常用的历法进行了封装,既 ...

  8. iOS - Swift NSCalendar 日历

    前言 public class NSCalendar : NSObject, NSCopying, NSSecureCoding NSCalendar 对世界上现存的常用的历法进行了封装,既提供了不同 ...

  9. iOS中的日历

    iOS自带三种日历,公历.佛教日历和日本日历,要设置日历可以进入"设置-通用-语言与地区-日历"设置,我们中国使用的iPhone默认设置成公历.而泰国人使用的iPhone默认设置的 ...

随机推荐

  1. SXCPC2018 nucoj2005 大闹上兰帝国

    超 dark van♂全背包 ref1 ref2 #include <iostream> #include <cstring> #include <cstdio> ...

  2. 谋哥:《App自推广》连载2直立人行走迁徙

    [谋哥每天一干货,第六十九篇] 前篇说到声音在远古时代,是一个神奇的东西,它能够很快地把信息传播到其他地方,突破了短距离.然而能人的后代直立人学会了直立行走,他们开始走出非洲,到达遥远的中东.中国,还 ...

  3. 在windows64位上安装Python3.0

    1.下载安装包 下载地址:https://www.python.org/downloads/ 如果要下载帮助文件:Download Windows help file 如果要下载基于网页的安装程序: ...

  4. 遇到的python3 不兼容 python2的地方

    python3中执行以下代码 >>> import subprocess >>> p=subprocess.Popen('ls',shell=True,stdout ...

  5. ZOJ 2112 Dynamic Rankings(带修改的区间第K大,分块+二分搜索+二分答案)

    Dynamic Rankings Time Limit: 10 Seconds      Memory Limit: 32768 KB The Company Dynamic Rankings has ...

  6. CTSC2018 旅游记

    我即使是死了,尸体烂在棺材里,也要用这腐朽的声音喊出: LJCCF!!!! DAY -3 体育中考AK了! 顿时感觉中考稳了(虽然竞赛已经特招) 新目标:我要用三种方式考上SZMS! DAY -1 成 ...

  7. javasript深度拷贝

    1 将json数据转换为字符串形式 var j={"name":"daenerys targaryen","dragon":"{& ...

  8. 初识laytpl

    laytpl-精致巧妙的JavaScript模板引擎 这两天在做一个mui项目,列表需要循环很多的数据.在公司同事的指引下认识了这个新的模板--laytpl.我只想说,很好用们很巧妙. 废话不多说,直 ...

  9. 【15】vuex2.0 之 modules

    vue 使用的是单一状态树对整个应用的状态进行管理,也就是说,应用中的所有状态都放到store中,如果是一个大型应用,状态非常多, store 就会非常庞大,不太好管理.这时vuex 提供了另外一种方 ...

  10. WML标签速查手册 wap标签

    原文发布时间为:2010-08-19 -- 来源于本人的百度文章 [由搬家工具导入] WML标签速查手册(转)比较方便便于速查   结构相关标签 语法及属性 <wml> <wml x ...